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 Zwer <zw...@ukr.net> on 2014/03/03 16:34:07 UTC

Multiple partial match

Hi Guys,

Faced with a problem: make query to SOLR *name:co*^5*

It returns me two docs with equal score: {id: 1, name: 'Coca-Cola Company'},
{id: 2, name: Microsoft Corporation}.


How can I boost Coca-Cola Company because it contains more partial matches ?


P.S. All normalization used by TF-IDF engine disabled.



--
View this message in context: http://lucene.472066.n3.nabble.com/Multiple-partial-match-tp4120886.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Multiple partial match

Posted by Zwer <zw...@ukr.net>.
AFAICS tf(name, 'co') returns 0 on the {id:1, name:'Coca-Cola Company'}
because it does not support partial match. 
tf(name, 'company') will return 1



--
View this message in context: http://lucene.472066.n3.nabble.com/Multiple-partial-match-tp4120886p4120919.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Multiple partial match

Posted by Jack Krupansky <ja...@basetechnology.com>.
Add a function query boost that uses the term frequency, "tf":

bf=tf(name,'co')  -- additive boost

boost=tf(name,'co')  -- multiplicative boost

That does of course require that term frequency is not disabled for that 
field in the schema.

You can multiply the term frequency as well in the function query.

boost=product(tf(name,'co'),10)

-- Jack Krupansky

-----Original Message----- 
From: Zwer
Sent: Monday, March 3, 2014 10:34 AM
To: solr-user@lucene.apache.org
Subject: Multiple partial match

Hi Guys,

Faced with a problem: make query to SOLR *name:co*^5*

It returns me two docs with equal score: {id: 1, name: 'Coca-Cola Company'},
{id: 2, name: Microsoft Corporation}.


How can I boost Coca-Cola Company because it contains more partial matches ?


P.S. All normalization used by TF-IDF engine disabled.



--
View this message in context: 
http://lucene.472066.n3.nabble.com/Multiple-partial-match-tp4120886.html
Sent from the Solr - User mailing list archive at Nabble.com.