lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From entdeveloper <cameron.develo...@gmail.com>
Subject Re: omitTermFreq only?
Date Wed, 01 Feb 2012 23:11:46 GMT
I know I'm kind of reopening a closed thread, but I now have the same
requirement to omitTermFreq only, but still have the ability to run phrase
queries on a field.

Thing is, having a custom Similarity and setting tf=1.0f will turn off term
frequencies globally, which is not what I need; I'd like to do it per field.

For sake of simplicity, I'm using dismax parser with *qf=name^10
description^5 body^1*, and *pf=name description body*. I'd like to turn off
tf for the /name/ field, but leave it for /description/ and /body/, while
allowing all of them to have positions so that phrase queries work.

Unfortunately, setting the /name/ field's omitTermFreqAndPositions="true"
also turns off the ability for phrases to work on /name/. Are there any
tricks to doing this? I've thought of a custom Similarity and having a
copyField for name (/name_phrase/) that leaves termFreqAndPositions, and
only using that field in the pf instead of /name/, but that won't really
work either. I also tried omitTermFreqAndPositions="true" and
omitPositions="false", but that's an invalid setting.



Markus Jelsma-2 wrote
> 
> A dirty hack is to return 1.0f for each tf > 0. Just a couple of lines
> code 
> for a custom similarity class.
> 
>> Hello,
>> 
>> I was wondering if there is a way we can omit only the Term Frequency in
>> solr?
>> 
>> omitTermFreqAndPositions =true wouldn't work for us since we need the
>> positions for supporting phrase queries.
>> 
>> Thanks,
>> -Jibo
> 


--
View this message in context: http://lucene.472066.n3.nabble.com/omitTermFreq-only-tp3167128p3708403.html
Sent from the Solr - User mailing list archive at Nabble.com.

Mime
View raw message