You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by farag ahmed <fa...@yahoo.com> on 2010/11/07 11:36:26 UTC

MoreLikeThis to extract relevant terms to the query from the index

Hi All,
 
I am using MoreLikeThis.java in lucene to expand the query with related terms. It works fine and I could't retrieve the relevant documents to the query but I couldn’t know how to extract the related terms to the query for the index. 
 
my task is:
 
 For example query is "bank" related terms can be "money", "credit" and so on that appeares frequntly with "bank" in the index.
 what I should write in the main even I get the interesting terms to my query?
 
i tried 
 
BooleanQuery result = (BooleanQuery) mlt.like(docNum); 

result.add(query, BooleanClause.Occur.MUST_NOT); 

System.out.println(result.getClauses().toString());
 
but it doesnt help

any idea



MoreLikeThis to extract relevant terms to the query from the index

Posted by farag ahmed <fa...@yahoo.com>.
Hi All,

I am using MoreLikeThis.java in lucene to expand the query with related terms. It works fine and I could retrieve the relevant documents to the query but I couldn’t know how to extract the related terms to the query for the index. 

my task is:

For example query is "bank" related terms can be "money", "credit" and so on that appeares frequntly with "bank" in the index.
what I should write in the main even I get the interesting terms to my query?

i tried 

BooleanQuery result = (BooleanQuery) mlt.like(docNum); 

result.add(query, BooleanClause.Occur.MUST_NOT); 

System.out.println(result.getClauses().toString());

but it doesnt help

any idea