我有多个lucene索引,我需要在这些索引上搜索查询字符串.所以我需要在所有这些索引上打开一个新的IndexSearcher还是可以用一个IndexSearcher来实现?
I have multiple lucene indexes that I would need to search on for a query string. So will I need to open a new IndexSearcher on all these indexes or can I achieve this with a single IndexSearcher?
谢谢
推荐答案可以使用 MultiSearcher .
它在多个子搜索器上实现Searchable接口.如果您只需要Searchable界面中的方法,它将像常规的IndexSearcher一样.
It implements the Searchable interface over multiple subsearchers. If you only need methods from the Searchable interface it will be just like a regular IndexSearcher to you.
如果需要访问找到文档的基础搜索者,则可以使用subSearcher(int)和subDoc(int)方法.
If you need to access the underlying searchers that found a document, you can use the subSearcher(int) and subDoc(int) methods.
lucene. apache/java/2_9_4/api/core/org/apache/lucene/search/MultiSearcher.html
更多推荐
在Lucene.Net中的多个索引搜索
发布评论