lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ahmet Arslan <>
Subject Re: Simple Similarity Implementation to Count the Number of Hits
Date Thu, 12 May 2016 12:58:41 GMT
Hi Luis,

Thats an interesting question. Can you share your similarity?
I suspect you return 1 expect Similarity#coord method.

Not sure but, for phrase query, one may require to modify ExactPhraseScorer/ExactPhraseScorer


On Thursday, May 12, 2016 5:41 AM, Luís Filipe Nassif <> wrote:


In the past (lucene 4) I have tried to implement a simple Similarity to
only count the number of occurrences (term frequencies) into the documents,
ignoring norms, doc frequencies, boosts... It worked for some queries like
term and wildcard queries, but not for others, like phrase and range
queries. Phrase query scores were being squared, eg, a phrase query with 2
terms was returning score 4 and a phrase query with 3 terms was returning
score 9, for a document with only one occurrence of the phrase.

Does someone have a working example or guideline for that implementation?

Thank you,

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

View raw message