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 Mossaab Bagdouri <ba...@yahoo.fr.INVALID> on 2016/12/14 19:27:10 UTC
Altering Term Frequency in Similarity
Hi,
I'm using Lucene 6.3.0, and trying to handle synonyms at query time.
I think I've handled DF correctly with BlendedTermQuery (by returning the
max DF of the synonyms). TTF is also handled by the same class.
Now, I want to handle the term frequency. As far as I can tell, raw TF is
given to the similarity class by score(int doc, float freq). Which class
does provide that freq? Or what can I change to provide a different freq
value, practically changing the document representation (e.g., freq[0] =
freq[0] + freq[1]; freq[1] = 0);
Regards,
Mossaab
Re: Altering Term Frequency in Similarity
Posted by Robert Muir <rc...@gmail.com>.
Maybe have a look at SynonymQuery:
https://github.com/apache/lucene-solr/blob/master/lucene/core/src/java/org/apache/lucene/search/SynonymQuery.java
I think it does a similar thing to what you want, it sums up the
frequencies of the synonyms and passes that sum to the similarity
class as TF.
On Wed, Dec 14, 2016 at 2:27 PM, Mossaab Bagdouri
<ba...@yahoo.fr.invalid> wrote:
> Hi,
>
>
> I'm using Lucene 6.3.0, and trying to handle synonyms at query time.
>
> I think I've handled DF correctly with BlendedTermQuery (by returning the
> max DF of the synonyms). TTF is also handled by the same class.
>
> Now, I want to handle the term frequency. As far as I can tell, raw TF is
> given to the similarity class by score(int doc, float freq). Which class
> does provide that freq? Or what can I change to provide a different freq
> value, practically changing the document representation (e.g., freq[0] =
> freq[0] + freq[1]; freq[1] = 0);
>
> Regards,
> Mossaab
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org