MoreLikeThis to extract relevant terms to the query from the index

2010-11-07 Thread farag ahmed
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

2010-11-07 Thread farag ahmed
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