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 Anirudha Jadhav <an...@nyu.edu> on 2013/08/28 22:35:51 UTC

coordination factor in between query terms

How can i specify coordination factor between query terms
eg. q="termA termB"

doc1= { field: termA}
doc2 = {field: termA termB termC termD }

I want doc2 scored higher than doc1

-- 
Anirudha P. Jadhav

Re: coordination factor in between query terms

Posted by Anirudha Jadhav <an...@nyu.edu>.
my bad, typo there q=termA termB

i know omitNorms is indexTime field option, can it be applied to the query
also?

are there other solutions to this kind of a problem? curious


On Wed, Aug 28, 2013 at 4:52 PM, Chris Hostetter
<ho...@fucit.org>wrote:

>
> 1) Coordination factor is controlled by the Similarity you have configured
> -- there is no request time option to affect hte coordination function.
> the Default Similarity already includes a simple ratio coord factor...
>
>
> https://lucene.apache.org/core/4_4_0/core/org/apache/lucene/search/similarities/DefaultSimilarity.html#coord%28int,%20int%29
>
> 2) your example query includes "quote" characters which makes it a phrase
> query, not a simple boolean query, so in that case both termA and termB
> will be required, and must be within the default slop number of term
> positions away from eachother.  if you instead used a query param
> of:  q=termA termB   ... then you'd see the coord factor come into play
>
> 3) in addition to the coord factor is the issue of fieldNorms -- but
> default text fields include a norm factor that takes into account
> thelength of a field, so in spite of the coord factor a very short field
> (ie; doc1) might score higher then a long field (ie: doc2) even if the lon
> field has more matches -- if you odn't want this, just use
> omitNorms="true" on your field.
>
>
> : How can i specify coordination factor between query terms
> : eg. q="termA termB"
> :
> : doc1= { field: termA}
> : doc2 = {field: termA termB termC termD }
> :
> : I want doc2 scored higher than doc1
> :
> : --
> : Anirudha P. Jadhav
> :
>
> -Hoss
>



-- 
Anirudha P. Jadhav

Re: coordination factor in between query terms

Posted by Chris Hostetter <ho...@fucit.org>.
1) Coordination factor is controlled by the Similarity you have configured 
-- there is no request time option to affect hte coordination function. 
the Default Similarity already includes a simple ratio coord factor...

https://lucene.apache.org/core/4_4_0/core/org/apache/lucene/search/similarities/DefaultSimilarity.html#coord%28int,%20int%29

2) your example query includes "quote" characters which makes it a phrase 
query, not a simple boolean query, so in that case both termA and termB 
will be required, and must be within the default slop number of term 
positions away from eachother.  if you instead used a query param 
of:  q=termA termB   ... then you'd see the coord factor come into play

3) in addition to the coord factor is the issue of fieldNorms -- but 
default text fields include a norm factor that takes into account 
thelength of a field, so in spite of the coord factor a very short field 
(ie; doc1) might score higher then a long field (ie: doc2) even if the lon 
field has more matches -- if you odn't want this, just use 
omitNorms="true" on your field.


: How can i specify coordination factor between query terms
: eg. q="termA termB"
: 
: doc1= { field: termA}
: doc2 = {field: termA termB termC termD }
: 
: I want doc2 scored higher than doc1
: 
: -- 
: Anirudha P. Jadhav
: 

-Hoss

Re: coordination factor in between query terms

Posted by Anirudha Jadhav <an...@nyu.edu>.
i don't know what term to boost.

I just need the documents with both terms listed as ranked higher. but
since Doc1 is smaller and has an exact match on the term as per tf-idf is
ranked higher.



On Wed, Aug 28, 2013 at 4:47 PM, Greg Walters
<gw...@sherpaanalytics.com>wrote:

> Just boost the term you want to show up higher in your results.
>
> http://wiki.apache.org/solr/SolrRelevancyCookbook#Boosting_Ranking_Terms
>
> - Greg
>
> -----Original Message-----
> From: anirudha81@gmail.com [mailto:anirudha81@gmail.com] On Behalf Of
> Anirudha Jadhav
> Sent: Wednesday, August 28, 2013 3:36 PM
> To: solr-user@lucene.apache.org
> Subject: coordination factor in between query terms
>
> How can i specify coordination factor between query terms eg. q="termA
> termB"
>
> doc1= { field: termA}
> doc2 = {field: termA termB termC termD }
>
> I want doc2 scored higher than doc1
>
> --
> Anirudha P. Jadhav
>



-- 
Anirudha P. Jadhav

RE: coordination factor in between query terms

Posted by Greg Walters <gw...@sherpaanalytics.com>.
Just boost the term you want to show up higher in your results.

http://wiki.apache.org/solr/SolrRelevancyCookbook#Boosting_Ranking_Terms

- Greg

-----Original Message-----
From: anirudha81@gmail.com [mailto:anirudha81@gmail.com] On Behalf Of Anirudha Jadhav
Sent: Wednesday, August 28, 2013 3:36 PM
To: solr-user@lucene.apache.org
Subject: coordination factor in between query terms

How can i specify coordination factor between query terms eg. q="termA termB"

doc1= { field: termA}
doc2 = {field: termA termB termC termD }

I want doc2 scored higher than doc1

--
Anirudha P. Jadhav