如何在GAE中实现自动建议(自动完成)功能 [英] How to implement auto suggestion (auto complete) functionality in GAE

查看:129
本文介绍了如何在GAE中实现自动建议(自动完成)功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Google App Engine(GAE / GWT)中实现自动建议功能。

实现的客户端与GWT SuggestBox和RPC正常工作。
我的主要问题是实现的服务器端。我尝试了谷歌搜索API,但似乎有250MB的索引数据总量的限制,搜索可以完整的单词而不是每个单词的部分!



我应该如何解决这个问题?我读过lucene或solr在GAE中不支持。
我会很感激你对此的想法。

解决方案

我采取了这种方法,


  1. 将文字分成单独的字词。摆脱重复,特殊字符和简短的单词(in,of和等)。

  2. 文本范围查询 listProperty> = wordPart&& listProperty< wordPart +\\\�



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.

解决方案

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"

这篇关于如何在GAE中实现自动建议(自动完成)功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆