Merge multiple queries from MoreLikeThis.like and do a new search
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.
精彩评论