Forgot to add the hits.score() to print out the hits score.
public void explainSearchScore(String indexLocation, DisjunctionMaxQuery
disjunctQuery){
IndexSearcher searcher = new
IndexSearcher(IndexReader.open(indexLocation));
Hits hits = searcher.search(disjunctQuery);
if(hits == null) return;
for(int i = 0; i < hits.length(); i++){
System.out.println("Hit " + i + ": " + hits.score(i) +
"\n" + searcher.explain(disjunctQuery, i).toString());
}
}
Find Me wrote:
public void explainSearchScore(String indexLocation,
DisjunctionMaxQuery disjunctQuery){
IndexSearcher searcher = new
IndexSearcher(IndexReader.open(indexLocation));
Hits hits = searcher.search(disjunctQuery);
if(hits == null) return;
for(int i = 0; i < hits.length(); i++){
System.out.println("Hit " + i + " " +
searcher.explain(disjunctQuery, i).toString());
}
}
On 9/19/06, *Chris Hostetter* <[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>> wrote:
: In the following output, each hit has two lines. The first line
is the hit
: score and the second line is the explanation given by the
: DisjunctionMaxQuery.
how are you printing the Explanation? .. are you using the toString()?
can you post a small self contained code example showing how you
got this
output?
: Hit 1: 0.6027994
: 0.0 = max plus 0.1 times others of:
:
: Hit 2: 0.59990174
: 0.0 = max plus 0.1 times others of:
:
: Hit 3: 0.41993123
: 0.0 = max plus 0.1 times others of:
-Hoss
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]