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 entdeveloper <ca...@gmail.com> on 2012/02/02 00:11:46 UTC

Re: omitTermFreq only?

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.

Re: omitTermFreq only?

Posted by Jack Krupansky <ja...@basetechnology.com>.
Please clarify. Be specific, with details.

-- Jack Krupansky

-----Original Message----- 
From: anasalkouz
Sent: Wednesday, November 07, 2012 5:19 AM
To: solr-user@lucene.apache.org
Subject: Re: omitTermFreq only?

Unfortunately, in Solr 4 all this omitTermFreqAndPositions not working
probably



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


Re: omitTermFreq only?

Posted by anasalkouz <aa...@souq.com>.
Unfortunately, in Solr 4 all this omitTermFreqAndPositions not working
probably 



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

Re: omitTermFreq only?

Posted by entdeveloper <ca...@gmail.com>.
iorixxx wrote
> 
>> 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.
> 
> I think, it is possible to use different similarities for different
> fields. https://issues.apache.org/jira/browse/SOLR-2338
> 

Ahh...guess I'll have to wait for Solr 4


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

Re: omitTermFreq only?

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

I think, it is possible to use different similarities for different fields. https://issues.apache.org/jira/browse/SOLR-2338