Partial matching GAE search API

后端 未结 6 844
日久生厌
日久生厌 2020-11-28 09:35

Using the GAE search API is it possible to search for a partial match?

I\'m trying to create autocomplete functionality where the term would be a partial word. eg.

6条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-28 09:56

    I have same problem for typeahead control, and my solution is parse string to small part :

    name='hello world'
    name_search = ' '.join([name[:i] for i in xrange(2, len(name)+1)])
    print name_search;
    # -> he hel hell hello hello  hello w hello wo hello wor hello worl hello world
    

    Hope this help

提交回复
热议问题