2
votes

I have some video titles stored in my solr index. I query based on title but want to have the rating to influence the score. The rating is a typical 5star rating. This rating is stored within solr along with the videos. I tried using the dismax request handler but looks like solr isn't boosting values.

You can see my requestHandler below:

<requestHandler default="true" name="dismax" class="solr.SearchHandler" >
<lst name="dismax">
 <str name="defType">dismax</str>
 <str name="echoParams">explicit</str>
 <float name="tie">0.01</float>
 <str name="qf">
    title
 </str>
 <str name="pf">
    title
 </str>
 <str name="mm">
    0
 </str>
 <str name="bq">
    rating:1^1.0 rating:2^1.0 rating:3^3.0 rating:4^5.0 rating:5^10.0
 </str>
 <str name="fl">
    *,score
 </str>
 <int name="ps">100</int>
 <str name="q.alt">*:*</str>
</lst>

Hope that someone can help me out!

I run the query with debug,This is the output of the debug. Can't see the rating field in the calculation of score...

4.429465 = (MATCH) weight(title:test in 1894), product of:

0.99999994 = queryWeight(title:test), product of: 4.4294653 = idf(docFreq=26876, maxDocs=829428) 0.22576088 = queryNorm 4.4294653 = (MATCH) fieldWeight(title:test in 1894), product of: 1.0 = tf(termFreq(title:test)=1) 4.4294653 = idf(docFreq=26876, maxDocs=829428) 1.0 = fieldNorm(field=title, doc=1894)

Some more debug information:

<lst name="debug">
<str name="rawquerystring">test</str>
<str name="querystring">test</str>
<str name="parsedquery">title:test</str>
<str name="parsedquery_toString">title:test</str>
<lst name="explain">...</lst>
<str name="QParser">LuceneQParser</str>
<arr name="filter_queries">
<str/>
</arr>
<arr name="parsed_filter_queries"/>
<lst name="timing">...</lst>
</lst>
1
Can you fire the query with the debugQuery=on and check the debug output.Jayendra

1 Answers

2
votes

Seems you have defined the list as dismax instead of defaults -

<requestHandler name="dismax" class="solr.SearchHandler" >
    <lst name="defaults">
        <str name="defType">dismax</str>
        <str name="echoParams">explicit</str>
        <float name="tie">0.01</float>
        <str name="qf">
            title
        </str>
        <str name="pf">
            title
        </str>
        <str name="mm">
            0
        </str>
        <str name="bq">
            rating:1^1.0 rating:2^1.0 rating:3^3.0 rating:4^5.0 rating:5^10.0
        </str>
        <str name="fl">
            *,score
        </str>
        <int name="ps">100</int>
        <str name="q.alt">*:*</str>
    </lst>
</requestHandler>

worked fine for me -

<str name="parsedquery">(+DisjunctionMaxQuery((title:itunes)~0.01) DisjunctionMaxQuery((title:itunes)~0.01) rating:1 rating:2 rating:3^3.0 rating:4^5.0 rating:5^10.0)/no_coord</str>