在Lucene.Net中的多个索引搜索

编程入门 行业动态 更新时间:2024-10-09 06:21:39
本文介绍了在Lucene.Net中的多个索引搜索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有多个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中的多个索引搜索

本文发布于:2023-11-28 20:20:22,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1643817.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:多个   索引   Lucene   Net

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!