You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Luís Filipe Nassif <lf...@gmail.com> on 2016/05/12 02:19:39 UTC

Simple Similarity Implementation to Count the Number of Hits

Hi,

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,
Luis

Re: Simple Similarity Implementation to Count the Number of Hits

Posted by Ahmet Arslan <io...@yahoo.com.INVALID>.
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 etc.

ahmet

On Thursday, May 12, 2016 5:41 AM, Luís Filipe Nassif <lf...@gmail.com> wrote:



Hi,

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,
Luis

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org