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 Jason <hi...@gmail.com> on 2015/12/28 07:54:14 UTC
how's multi-query scoring?
Hi, all
I'm wondering how multi generated queries are scoring.
My schema setting is
<fieldType name="test" class="solr.TextField" omitNorms="false"
positionIncrementGap="100">
<analyzer type="query">
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.StopFilterFactory" ignoreCase="true"
words="lang/stopwords_en.txt" enablePositionIncrements="true" />
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="1"
generateNumberParts="1" catenateWords="0" catenateNumbers="0"
catenateAll="0" splitOnCaseChange="1"/>
<filter class="solr.LowerCaseFilterFactory" />
</analyzer>
</fiedldType>
If I query test:chloro-4-hydroxy with default opearator AND,
result is below
<lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">300</int>
<lst name="params">
<str name="debugQuery">true</str>
<str name="fl">*,score</str>
<str name="indent">true</str>
<str name="q">test:chloro-4-hydroxy</str>
<str name="q.op">AND</str>
<str name="wt">xml</str>
</lst>
</lst>
<result name="response" numFound="2" start="0" maxScore="1.8082676">
<doc>
<str name="id">test1</str>
<str name="test">chloro-4-hydroxy meaningless word</str>
<float name="score">1.8082676</float></doc>
<doc>
<str name="id">test2</str>
<str name="test">chloro 4 meaningless word hydroxy</str>
<float name="score">1.8082676</float></doc>
</result>
Socre of two document is same.
If possible, I want to more score at doc id 'test1'.
'chloro', '4', 'hydroxy' are close each other in 'test1'.
But 'hydroxy' is far from 'chloro' and '4' in 'test2'.
I think 'test1' is more proper than 'test2'.
Is there a way to give more score according to distance among the query
terms?
--
View this message in context: http://lucene.472066.n3.nabble.com/how-s-multi-query-scoring-tp4247512.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: how's multi-query scoring?
Posted by Binoy Dalal <bi...@gmail.com>.
Precisely. You can change how solr generates your phrase queries by
tweaking the worddelimiterfactory settings or setting the
autogeneratephrasequeries parameter for your fields to true or false.
This will also determine whether or not pf boosting is applied.
On Tue, 29 Dec 2015, 10:41 Jason <hi...@gmail.com> wrote:
> Hi, Binoy
> Thanks your reply.
>
> I've found why score is same.
> If I query with test:(chloro-4-hydroxy), then score is same.
> But quering with test:(chloro 4 hydroxy), thean score of id 'test1' is
> bigger than 'test2'.
> So pf parameter under edismax is only applied to explicitly separated
> queries.
> In my case, quering with test:(chloro-4-hydroxy) generates implicit term
> query like (chloro 4 hydroxy) by worddelimiterfilter.
> So pf is not apppied.
>
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/how-s-multi-query-scoring-tp4247512p4247648.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
--
Regards,
Binoy Dalal
Re: how's multi-query scoring?
Posted by Jason <hi...@gmail.com>.
Hi, Binoy
Thanks your reply.
I've found why score is same.
If I query with test:(chloro-4-hydroxy), then score is same.
But quering with test:(chloro 4 hydroxy), thean score of id 'test1' is
bigger than 'test2'.
So pf parameter under edismax is only applied to explicitly separated
queries.
In my case, quering with test:(chloro-4-hydroxy) generates implicit term
query like (chloro 4 hydroxy) by worddelimiterfilter.
So pf is not apppied.
--
View this message in context: http://lucene.472066.n3.nabble.com/how-s-multi-query-scoring-tp4247512p4247648.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: how's multi-query scoring?
Posted by Binoy Dalal <bi...@gmail.com>.
Yes you use the pf options under edismax.
Have you indexed the field with term frequencies and position data?
Because slop basically works with phrase queries for which you need the
term frequencies and positions available.
On Mon, 28 Dec 2015, 15:02 Jason <hi...@gmail.com> wrote:
> I know the analysis tool under solr admin ui.
>
> Specifying slop for query fields is the using edismax, right?
>
> I have quried using edismax like below.
>
>
> http://localhost:8080/solr/collection1/select?q=test:(chloro-4-hydroxy)&fl=*,score&debugQuery=true&q.op=AND&qf=test&pf=test~1
> ^2.0&defType=edismax
>
> But score of two docs is still same.
>
> How can i do like yours?
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/how-s-multi-query-scoring-tp4247512p4247517.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
--
Regards,
Binoy Dalal
Re: how's multi-query scoring?
Posted by Jason <hi...@gmail.com>.
I know the analysis tool under solr admin ui.
Specifying slop for query fields is the using edismax, right?
I have quried using edismax like below.
http://localhost:8080/solr/collection1/select?q=test:(chloro-4-hydroxy)&fl=*,score&debugQuery=true&q.op=AND&qf=test&pf=test~1^2.0&defType=edismax
But score of two docs is still same.
How can i do like yours?
--
View this message in context: http://lucene.472066.n3.nabble.com/how-s-multi-query-scoring-tp4247512p4247517.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: how's multi-query scoring?
Posted by Binoy Dalal <bi...@gmail.com>.
You can do this by specifying slop for your fields.
If you want to see how exactly your query is being treated you should use
the analysis tool that is available in the solr admin ui under your
collection name.
On Mon, 28 Dec 2015, 12:24 Jason <hi...@gmail.com> wrote:
> Hi, all
> I'm wondering how multi generated queries are scoring.
>
> My schema setting is
>
> <fieldType name="test" class="solr.TextField" omitNorms="false"
> positionIncrementGap="100">
> <analyzer type="query">
> <tokenizer class="solr.WhitespaceTokenizerFactory"/>
> <filter class="solr.StopFilterFactory" ignoreCase="true"
> words="lang/stopwords_en.txt" enablePositionIncrements="true" />
> <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1"
> generateNumberParts="1" catenateWords="0" catenateNumbers="0"
> catenateAll="0" splitOnCaseChange="1"/>
> <filter class="solr.LowerCaseFilterFactory" />
> </analyzer>
> </fiedldType>
>
>
> If I query test:chloro-4-hydroxy with default opearator AND,
> result is below
>
> <lst name="responseHeader">
> <int name="status">0</int>
> <int name="QTime">300</int>
> <lst name="params">
> <str name="debugQuery">true</str>
> <str name="fl">*,score</str>
> <str name="indent">true</str>
> <str name="q">test:chloro-4-hydroxy</str>
> <str name="q.op">AND</str>
> <str name="wt">xml</str>
> </lst>
> </lst>
> <result name="response" numFound="2" start="0" maxScore="1.8082676">
> <doc>
> <str name="id">test1</str>
> <str name="test">chloro-4-hydroxy meaningless word</str>
> <float name="score">1.8082676</float></doc>
> <doc>
> <str name="id">test2</str>
> <str name="test">chloro 4 meaningless word hydroxy</str>
> <float name="score">1.8082676</float></doc>
> </result>
>
>
> Socre of two document is same.
> If possible, I want to more score at doc id 'test1'.
> 'chloro', '4', 'hydroxy' are close each other in 'test1'.
> But 'hydroxy' is far from 'chloro' and '4' in 'test2'.
> I think 'test1' is more proper than 'test2'.
> Is there a way to give more score according to distance among the query
> terms?
>
>
>
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/how-s-multi-query-scoring-tp4247512.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
--
Regards,
Binoy Dalal