How to implement auto suggestion (auto complete) f

2019-04-26 08:53发布

I want to implement auto suggest functionality in Google App Engine (GAE/GWT).

The client side of the implementation works fine with GWT SuggestBox and RPC. My main issue is the server side of the implementation. I tried the Google search API but it seems that there is a limitation of 250MB of total indexed data and the search can be performed on complete words and not parts of each word!

How should I approach this? I read that lucene or solr is not supported in GAE. I would appreciate your thoughts on this.

2条回答
做个烂人
2楼-- · 2019-04-26 09:50

You can achieve a basic text search using these techniques described here: http://googlecode.blogspot.com.br/2010/05/google-app-engine-basic-text-search.html

In short:

Build a query using content >= yourQuery && content < yourQuery + "\ufffd", where the content property of your entity can be a String or a List of Strings.

查看更多
何必那么认真
3楼-- · 2019-04-26 09:55

I've taken this approach and it works fine for me:

  1. Split up text into separate words. Get rid of duplicates, special characters and short words (in, of, and, etc..).

  2. Add this list of words to entity as a list property.

  3. Search via text range query: listProperty >= wordPart && listProperty < wordPart + "\ufffd"

查看更多
登录 后发表回答