在Lucene.Net中的多个索引搜索 [英] Multiple Indexes search in Lucene.Net
问题描述
我有多个lucene.net索引,我需要在这些索引上搜索查询字符串.所以我需要在所有这些索引上打开一个新的IndexSearcher还是可以用一个IndexSearcher来实现?
I have multiple lucene.net 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?
谢谢
推荐答案
可以使用它在多个子搜索器上实现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.
http://lucene. apache.org/java/2_9_4/api/core/org/apache/lucene/search/MultiSearcher.html
这篇关于在Lucene.Net中的多个索引搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!