Different order of results Lucene vs Luke

138 views
Skip to first unread message

dmpolo

unread,
Oct 14, 2011, 11:53:43 AM10/14/11
to Luke - Lucene Index Toolbox
Hi,

I'm obtaining different results doing a search with Lucene 3.1 from
the results obtained with Luke 3.1.

The query is exactly the same and the number of results is the same,
but the order is different.

Here is the code printing the first 10 results:

Directory directory = FSDirectory.open(new File("C:/data/indexes/
com.test.TestObject"));
IndexReader indexReader = IndexReader.open(directory);
IndexSearcher indexSearcher = new IndexSearcher(indexReader);
TopDocs hits = indexSearcher.search(query, 10);
for (ScoreDoc sd : hits.scoreDocs) {
System.out.println("doc:" + sd.doc + " - score: " + sd.score);
}
indexSearcher.close();

After examining the results I have found that the order obtained with
Luke is the good one. So, I'm interested in

Is there something I'm missing? Maybe some configuration of Lucene?

Andrzej Bialecki

unread,
Oct 14, 2011, 2:18:54 PM10/14/11
to luke-d...@googlegroups.com

You didn't show us how you constructed the "query" object in your
code... Also, just print Explanations, things should become obvious then.


--
Best regards,
Andrzej Bialecki<><
___. ___ ___ ___ _ _ __________________________________
[__ || __|__/|__||\/| Information Retrieval, Semantic Web
___|||__|| \| || | Embedded Unix, System Integration
http://www.sigram.com Contact: info at sigram dot com


Reply all
Reply to author
Forward
0 new messages