java - 适用于 Google App Engine 的最佳 Java 文本索引库是什么?

标签 java google-app-engine full-text-indexing

目前我知道 compass 可以处理这项工作。但是用罗盘索引看起来很昂贵。有没有更轻的替代品?

最佳答案

老实说,我不知道 Lucene 在索引方面是否会比 Compass 更轻(为什么会这样,Compass 不为此使用 Lucene?)。

无论如何,因为您要求替代品,所以有 GAELucene .我在引用 its announcement下面:

Enlightened by the discussion "Can I run Lucene in google app engine?", I implemented a google datastore based Lucene component, GAELucene, which can help you to run search applications on google app engine.

The main clazz of GAELucene include:

  • GAEDirectory - a read only Directory based on google datastore.
  • GAEFile - stands for an index file, the file's byte content will be splited into multi GAEFileContent.
  • GAEFileContent - stands for a segment of index file.
  • GAECategory - the identifier of different indices.
  • GAEIndexInput - a memory-resident IndexInput? implementation like the RAMInputStream.
  • GAEIndexReader - wrapper for IndexReader? that cached in GAEIndexReaderPool
  • GAEIndexReaderPool - pool for GAEIndexReader

The following code snippet demonstrates the use of GAELucene do searching:

Query queryObject = parserQuery(request);
GAEIndexReaderPool readerPool = GAEIndexReaderPool.getInstance();
GAEIndexReader indexReader = readerPool.borrowReader(INDEX_CATEGORY_DEMO);
IndexSearcher searcher = newIndexSearcher(indexReader);
Hits hits = searcher.search(queryObject);
readerPool.returnReader(indexReader);

我强烈建议阅读有关 nabble 的整个讨论,内容非常丰富。

为了以防万一,关于 Compass,Shay Banon 在这里写了一篇博客文章,详细介绍了如何在 App Engine 中使用 Compass:http://www.kimchy.org/searchable-google-appengine-with-compass/

关于java - 适用于 Google App Engine 的最佳 Java 文本索引库是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1995826/

相关文章:

java - GlassFish 身份验证基本用户名和密码

python - GAE 模型 Hook 在管理服务器上不起作用。为什么?

java - Google App Engine : WARNING: failed Server@3d484a8a: java.net.BindException:地址已在使用中

java - 使用 Java、Eclipse 创建 RESTful Web 服务的教程。 Apache Tomcat,不工作

java - 特立尼达 2.0 是否已被取代或废弃?

java - 当使用与主键不同的列(referencedColumnName)映射关系时,如何阻止 Hibernate 急切地获取关系?

java - 使用 Google App Engine(Java) 的 Facebook 聊天问题

mysql - 全文搜索无法正常工作

sql-server - 如何从 SQL Server 事务中刷新全文索引

mysql - MySQL全文搜索如何工作?