开发者

Merge multiple queries from MoreLikeThis.like and do a new search

开发者 https://www.devze.com 2023-01-23 13:34 出处:网络
I am using the lucene 3.0.2 framework for a little project. I need to create new queries, on relevant documents (multiple) and do a new search that is more relevant to the chosen documents.

I am using the lucene 3.0.2 framework for a little project. I need to create new queries, on relevant documents (multiple) and do a new search that is more relevant to the chosen documents.

So far I have added all the documents marked from the user into a ArrayList<Document>, and then created an ArrayList<Query> with queries that MoreLikeThis.like(docId) created for me.

Now, with all these new queries from the relevant documents, I need to somehow merge them. Problem is that Query can not cast to BooleanQuery, and the only method I find for 开发者_如何学运维merging queries is Query.mergeBooleanQueries, but nothing about just Query.

Any tips? :)

Thx


I found a solution. The instance-method combine will worked. Strange this isn't a static method tho.

0

精彩评论

暂无评论...
验证码 换一张
取 消