Consider the following. Query: term1 term2 Doc1: term1 term2 Doc2: term1 term2 term3 term4 Doc3: term1 term1 term3 Doc4: term3 term4
For the above documents, Doc1 and Doc2 will b exact match ( as they contain all the terms in the search Query). Doc3 is partially match as it contains term1 only (we neglect the term frequency tf always 1 The score percentage ( calculated by Lucene in Hits.java line 133) and will be Doc1: 100% Doc2: 100% Doc3: 80% This is not a problem at all, the problem occurs when there is no exact matching document as following: Query: term1 term2 Doc1: term1 term3 Doc2: term2 term3 term4 Doc3: term1 term1 term3 Doc4: term3 term4 The score will be calculated as Doc1: 100% Doc2: 100% Doc3: 50% You can see that Doc1 and Doc2 got 100% despite that they are not exact match. but as they got the highest score, Lucene considers them 100% match. This is my problem All I need is to make the percentage correct in the second case so it will be something as Doc1: 50% Doc2: 50% Doc3: 30% I hope I made myself clear. -- View this message in context: http://lucene.472066.n3.nabble.com/Search-Score-percentage-Should-not-be-relative-to-the-highest-score-tp2183420p2184613.html Sent from the Lucene - Java Users mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org