Google App Engine上的全文搜索(Java) [英] Full text search on Google App Engine (Java)

查看:113
本文介绍了Google App Engine上的全文搜索(Java)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个主题有几条线索,但我认为我的用例有所不同。



我想要做什么:




  • 我的GAE / J应用程序的全文搜索组件

  • 索引大小很小:25-50MB左右

  • 我不需要对索引进行实时更新,定期重新索引很好

  • 这是自动完成之类的,所以它需要非常快速(我认为在数据存储中实现倒排索引会带来相当大的延迟)


    到目前为止我的策略


    • 将Lucene与RAMDirectory结合使用

    • A定期的cron作业创建索引,将其序列化到数据存储,存储更新标识(或时间戳)。
    • 搜索servlet在启动时加载索引并创建RAMDirectory
    • 在每个请求上,servlet检查当前的更新ID并重新加载t他根据需要进行索引



    我很模糊的主要原因是如何同步实例之间的内存数据 - 或者我错过了什么?



    另外,在我开始有内存使用问题之前,我能推多少?我找不到GAE的RAM配额。 (这个指数很小,但我可以想到更多的东西我想补充)



    当然,有关更好方法的想法吗?

    解决方案

    那么,从GAE 1.5.0看起来就像居民后端可以用来创建一个搜索服务。



    当然,这些没有免费配额。


    There are a few threads floating around on the topic, but I think my use-case is somewhat different.

    What I want to do:

    • Full text search component for my GAE/J app
    • The index size is small: 25-50MB or so
    • I do not need live updates to the index, a periodic re-indexing is fine
    • This is for auto-complete and the like, so it needs to be extremely fast (I get the impression that implementing an inverted index in Datastore introduces considerable latency)

    My strategy so far (just planning, haven't tried implementing anything yet):

    • Use Lucene with RAMDirectory
    • A periodic cron job creates the index, serializes it to the Datastore, stores an update id (or timestamp)
    • Search servlet loads the index on startup and creates the RAMDirectory
    • On each request the servlet checks the current update id and reloads the index as necessary

    The main thing I'm fuzzy on is how to synchronize in-memory data between instances - will this work, or am I missing something?

    Also, how far can I push it before I start having problems with memory use? I couldn't find anything on RAM quotas for GAE. (This index is small, but I can think of more stuff I'd like to add)

    And, of course, any thoughts on better approaches?

    解决方案

    Well, as of GAE 1.5.0 looks like resident Backends can be used to create a search service.

    Of course, there's no free quota for these.

    这篇关于Google App Engine上的全文搜索(Java)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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