You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Andreas Schwarz <an...@andreas-s.net> on 2010/01/06 20:32:37 UTC
How to ignore term frequency >1? Field-specific Similarity class?
Hi,
I want to modify scoring to ignore term frequency > 1. This is useful for short fields like titles or subjects, where the number of times a term appears does not correspond to relevancy. I found several discussions of this problem, and also an implementation that changes the Similarity class to achieve this (http://osdir.com/ml/solr-user.lucene.apache.org/2009-09/msg00672.html). However, this change is global, but I only need the behavior for some fields. What's the best way to do this? Is there a way to use a field-specific similarity class, or to evaluate field names/parameters inside a Similarity class?
Thanks!
Andreas
Re: How to ignore term frequency >1? Field-specific Similarity class?
Posted by Chris Hostetter <ho...@fucit.org>.
: I want to modify scoring to ignore term frequency > 1. This is useful
...
: fields. What's the best way to do this? Is there a way to use a
: field-specific similarity class, or to evaluate field names/parameters
: inside a Similarity class?
The Similarity API let's you customize the tf function to have different
behavior based on teh field name, but if you really don'tcare about term
freq for some fields, you can also use <field ...
omitTermFreqAndPositions="true" /> to keep it out of your index
completely. (if your <schema/> has "version=1.2" then that's the default
for most field types, but you have to set it to true explicitly for
TextField)
-Hoss