lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bsargurunathan <>
Subject Lucene Search with MoreLiktThis
Date Fri, 08 Apr 2011 07:36:52 GMT
I need some ideas about Lucene MoreLikeThis. I want search the records
conditioning with more that one field name using MoreLikeThis. Right now i
did some codes like

IndexReader indexreader ="FAW.Lucene.index_path"));
IndexSearcher searcher = new IndexSearcher(indexreader);
MoreLikeThis mlt = new MoreLikeThis(indexreader);
Query query =;
mlt.setFieldNames(new String[]{"serviceNumber","env"});
Hits list =;
Iterator itr1 = list.iterator();

But its fetching all the records with the matching of "serviceNumber" and
"env". But i need to get the common records of this fields...

ServiceNumber     env            Value
1                       env1             2
1                       env2             3
2                       env1             4
1                       env1             5

If the data are like this means.. I want fetch
ServiceNumber            env          Value
1                              env1          2
1                              env1          5

This is my requirement. Can anyone help for me or if any ideas....Thanks in

View this message in context:
Sent from the Lucene - Java Developer mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message