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 abhayd <aj...@hotmail.com> on 2012/08/01 14:43:25 UTC

termFrequncy off and still use fastvector highlighter?

hi
We would like to turn off TF for a field but we still want to use fast
vector highlighter.

How would we do that?




--
View this message in context: http://lucene.472066.n3.nabble.com/termFrequncy-off-and-still-use-fastvector-highlighter-tp3998590.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: termFrequncy off and still use fastvector highlighter?

Posted by abhayd <aj...@hotmail.com>.
that helps



--
View this message in context: http://lucene.472066.n3.nabble.com/termFrequncy-off-and-still-use-fastvector-highlighter-tp3998590p4000575.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: termFrequncy off and still use fastvector highlighter?

Posted by Tanguy Moal <ta...@gmail.com>.
Hum sorry I think I didn't get your point right!

Maybe what you want to do is more like providing a custom similarity for
scoring of matches, see
http://lucene.apache.org/core/old_versioned_docs/versions/3_5_0/api/core/org/apache/lucene/search/package-summary.html#changingSimilarity

That way you can keep the termPositions (enabling phrase searches) but make
the frequency have no impact in scoring by making the tf() method return a
constant value (say 1) instead of the real terms' frequencies.

Is this what you were looking for ?
If so, you'll have to package you're own code into a jar and make that jar
accessible to solr, see http://wiki.apache.org/solr/SolrPlugins for how to
plug your custom code into Solr.

The main drawback of that approach is that it will be activated for all
queries and all fields...

--
Tanguy

2012/8/7 Tanguy Moal <ta...@gmail.com>

> May be it wasn't clear in my response, sorry!
> You can use a different field for searching (qf parameter for dismax) than
> the one for highlighting (hl.fl) :
> q="a phrase
> query"&qf="text_without_termFreqs"&hl=on&hl.fl="text_with_termFreqs".
>
> Scoring will be based on fq's fields only (i.e. those without termFreqs).
> Highlighting will be base on hl.fl's fields only (i.e. those with
> termFreqs,
> as required by fast vector highlighter)
>
> Is it any clearer ? :-)
>
> Best regards,
>
> Tanguy
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/termFrequncy-off-and-still-use-fastvector-highlighter-tp3998590p3999544.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Re: termFrequncy off and still use fastvector highlighter?

Posted by Tanguy Moal <ta...@gmail.com>.
May be it wasn't clear in my response, sorry!
You can use a different field for searching (qf parameter for dismax) than
the one for highlighting (hl.fl) :
q="a phrase
query"&qf="text_without_termFreqs"&hl=on&hl.fl="text_with_termFreqs".

Scoring will be based on fq's fields only (i.e. those without termFreqs).
Highlighting will be base on hl.fl's fields only (i.e. those with termFreqs,
as required by fast vector highlighter)

Is it any clearer ? :-)

Best regards,

Tanguy



--
View this message in context: http://lucene.472066.n3.nabble.com/termFrequncy-off-and-still-use-fastvector-highlighter-tp3998590p3999544.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: termFrequncy off and still use fastvector highlighter?

Posted by abhayd <aj...@hotmail.com>.
yes u r correct. But problem is u can not just turnOff term frequency. You
have to turn off termpositions with it. And once i do that phrase searches
dont work.

I want termPositions=false termPositions=true

How would i do that?




--
View this message in context: http://lucene.472066.n3.nabble.com/termFrequncy-off-and-still-use-fastvector-highlighter-tp3998590p3999260.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: termFrequncy off and still use fastvector highlighter?

Posted by Tanguy Moal <ta...@gmail.com>.
If think you could use a field without the term frequencies for searching,
that will solve your relevancy issues.
You can then have the exact same content in an other field (using a
copyField directive in your schema), having terms frequencies and positions
turned on, and use this particuliar for highlighting.
Searching and highlighting can be totally separated from my understanding.
You could even use an alternate query using the hl.q parameter so that you
can highlight terms that were not searched for, or have terms searched but
not highlighted.

Hope this helps,

--
Tanguy

2012/8/2 abhayd <aj...@hotmail.com>

> So we have some content where document title is like this
>
> "Accessory for iphone, iphone4, iphone 4s"
>
> So these one come on top results for iphone. This could be content
> authoring
> issue. But we are looking into avoiding such content to come on top.
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/termFrequncy-off-and-still-use-fastvector-highlighter-tp3998590p3998820.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Re: termFrequncy off and still use fastvector highlighter?

Posted by abhayd <aj...@hotmail.com>.
So we have some content where document title is like this

"Accessory for iphone, iphone4, iphone 4s"

So these one come on top results for iphone. This could be content authoring
issue. But we are looking into avoiding such content to come on top.



--
View this message in context: http://lucene.472066.n3.nabble.com/termFrequncy-off-and-still-use-fastvector-highlighter-tp3998590p3998820.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: termFrequncy off and still use fastvector highlighter?

Posted by Erick Erickson <er...@gmail.com>.
what do you expect to gain by turning off TF?

This feels a bit like an XY problem....

Best
Erick

On Wed, Aug 1, 2012 at 8:43 AM, abhayd <aj...@hotmail.com> wrote:
> hi
> We would like to turn off TF for a field but we still want to use fast
> vector highlighter.
>
> How would we do that?
>
>
>
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/termFrequncy-off-and-still-use-fastvector-highlighter-tp3998590.html
> Sent from the Solr - User mailing list archive at Nabble.com.