2

I am developing an application that requires a CLucene index to be created in a desktop application, but replicated for (read-only) searching on iOS devices and efficiently updated when the index is updated.

Aside from simply re-downloading the entire index whenever it changes, what are my options here? CLucene does not support replication on its own, but Solr (which is built on top of Lucene) does, so it's clearly possible. Does anybody know how Solr does this and how one would approach implementing similar functionality?

If this is not possible, are there any (non-Java-based) full-text search implementations that would meet my needs better than CLucene?

Querying the desktop application is not an option - the mobile applications must be able to search offline.

4

1 回答 1

4

Lucene 索引基于一次写入多次读取的段。这意味着当新文档被提交到 Lucene 索引时,您只需要检索:

  • 新的细分市场,
  • 合并的段(已合并到单个段中的旧段,如果有的话),
  • 段文件(存储有关当前段的信息)。

一旦下载了所有这些新文件,就可以安全地删除已合并的段文件。要考虑更改,只需重新打开 IndexReader。

Solr 有一个 Java 实现可以做到这一点,但考虑到它的简单性,使用 rsync 之类的同步工具也可以做到这一点。顺便说一句,这就是 Solr 复制在 Solr 1.4 之前的工作方式,您仍然可以在 wiki 上找到一些关于 rsync 复制的文档

于 2012-03-20T20:32:59.133 回答