need help with getting exact matches to score higher

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

need help with getting exact matches to score higher

geeky2
Hello all,


i am trying to tune our core for exact matches on a single field (itemNo) and having issues getting it to work.  

in addition - i need help understanding the output from debugQuery=on where it presents the scoring.

my goal is to get exact matches to arrive at the top of the results.  however - what i am seeing is non-exact matches arrive at the top of the results with MUCH higher scores.



// from schema.xml - i am copying itemNo in to the string field for use in boosting

  <field name="itemNoExactMatchStr"      type="string" indexed="true" stored="false"/>
  <copyField source="itemNo" dest="itemNoExactMatchStr"/>

// from solrconfig.xml - i have the boost set for my special exact match field and the sorting on score desc.

  <requestHandler name="itemNoProductTypeBrandSearch" class="solr.SearchHandler" default="false">
    <lst name="defaults">
      <str name="defType">edismax</str>
      <str name="echoParams">all</str>
      <int name="rows">10</int>
      <str name="qf">itemNoExactMatchStr^30 itemNo^.9 divProductTypeDesc^.8 brand^.5</str>
      <str name="q.alt">*:*</str>
      <str name="sort">score desc</str>
      <str name="facet">true</str>
      <str name="facet.field">itemDescFacet</str>
      <str name="facet.field">brandFacet</str>
      <str name="facet.field">divProductTypeIdFacet</str>
    </lst>
    <lst name="appends">
    </lst>
    <lst name="invariants">
    </lst>
  </requestHandler>



// analysis output from debugQuery=on

here you can see that the top socre for itemNo:9030 is a part that does not start with 9030.

the entries below (there are 4) all have exact matches - but they rank below this part - ???



<str name="0904000,1354  ,<b>2TTZ9030C1000A                     ">
0.585678 = (MATCH) max of:
  0.585678 = (MATCH) weight(itemNo:9030^0.9 in 582979), product of:
    0.021552926 = queryWeight(itemNo:9030^0.9), product of:
      0.9 = boost
      10.270785 = idf(docFreq=55, maxDocs=594893)
      0.0023316324 = queryNorm
    27.173943 = (MATCH) fieldWeight(itemNo:9030 in 582979), product of:
      2.6457512 = tf(termFreq(itemNo:9030)=7)
      10.270785 = idf(docFreq=55, maxDocs=594893)
      1.0 = fieldNorm(field=itemNo, doc=582979)
</str>



<str name="1220000,1232  ,<b>9030                               ">
0.22136548 = (MATCH) max of:
  0.22136548 = (MATCH) weight(itemNo:9030^0.9 in 499864), product of:
    0.021552926 = queryWeight(itemNo:9030^0.9), product of:
      0.9 = boost
      10.270785 = idf(docFreq=55, maxDocs=594893)
      0.0023316324 = queryNorm
    10.270785 = (MATCH) fieldWeight(itemNo:9030 in 499864), product of:
      1.0 = tf(termFreq(itemNo:9030)=1)
      10.270785 = idf(docFreq=55, maxDocs=594893)
      1.0 = fieldNorm(field=itemNo, doc=499864)
</str>

<str name="0537220,1882  ,<b>9030                               ">
0.22136548 = (MATCH) max of:
  0.22136548 = (MATCH) weight(itemNo:9030^0.9 in 538826), product of:
    0.021552926 = queryWeight(itemNo:9030^0.9), product of:
      0.9 = boost
      10.270785 = idf(docFreq=55, maxDocs=594893)
      0.0023316324 = queryNorm
    10.270785 = (MATCH) fieldWeight(itemNo:9030 in 538826), product of:
      1.0 = tf(termFreq(itemNo:9030)=1)
      10.270785 = idf(docFreq=55, maxDocs=594893)
      1.0 = fieldNorm(field=itemNo, doc=538826)
</str>

<str name="0537220,2123  ,<b>9030                               ">
0.22136548 = (MATCH) max of:
  0.22136548 = (MATCH) weight(itemNo:9030^0.9 in 544313), product of:
    0.021552926 = queryWeight(itemNo:9030^0.9), product of:
      0.9 = boost
      10.270785 = idf(docFreq=55, maxDocs=594893)
      0.0023316324 = queryNorm
    10.270785 = (MATCH) fieldWeight(itemNo:9030 in 544313), product of:
      1.0 = tf(termFreq(itemNo:9030)=1)
      10.270785 = idf(docFreq=55, maxDocs=594893)
      1.0 = fieldNorm(field=itemNo, doc=544313)
</str>

<str name="0537220,2087  ,<b>9030                               ">
0.22136548 = (MATCH) max of:
  0.22136548 = (MATCH) weight(itemNo:9030^0.9 in 544657), product of:
    0.021552926 = queryWeight(itemNo:9030^0.9), product of:
      0.9 = boost
      10.270785 = idf(docFreq=55, maxDocs=594893)
      0.0023316324 = queryNorm
    10.270785 = (MATCH) fieldWeight(itemNo:9030 in 544657), product of:
      1.0 = tf(termFreq(itemNo:9030)=1)
      10.270785 = idf(docFreq=55, maxDocs=594893)
      1.0 = fieldNorm(field=itemNo, doc=544657)
</str>





Reply | Threaded
Open this post in threaded view
|

Re: need help with getting exact matches to score higher

Tanguy Moal
Hello,
From the response you pasted here, it looks like the field
"itemNoExactMatchStr"
never matched.

Can you try matching in that field only and ensure you have matches ? Given
the ^30 boost, you should have high scores on this field...

Hope this helps,

--
Tanguy

2012/5/15 geeky2 <[hidden email]>

> Hello all,
>
>
> i am trying to tune our core for exact matches on a single field (itemNo)
> and having issues getting it to work.
>
> in addition - i need help understanding the output from debugQuery=on where
> it presents the scoring.
>
> my goal is to get exact matches to arrive at the top of the results.
> however - what i am seeing is non-exact matches arrive at the top of the
> results with MUCH higher scores.
>
>
>
> // from schema.xml - i am copying itemNo in to the string field for use in
> boosting
>
>  <field name="itemNoExactMatchStr"      type="string" indexed="true"
> stored="false"/>
>  <copyField source="itemNo" dest="itemNoExactMatchStr"/>
>
> // from solrconfig.xml - i have the boost set for my special exact match
> field and the sorting on score desc.
>
>  <requestHandler name="itemNoProductTypeBrandSearch"
> class="solr.SearchHandler" default="false">
>    <lst name="defaults">
>      <str name="defType">edismax</str>
>      <str name="echoParams">all</str>
>      <int name="rows">10</int>
>      *<str name="qf">itemNoExactMatchStr^30 itemNo^.9 divProductTypeDesc^.8
> brand^.5</str>*
>      <str name="q.alt">*:*</str>
>     * <str name="sort">score desc</str>*
>      <str name="facet">true</str>
>      <str name="facet.field">itemDescFacet</str>
>      <str name="facet.field">brandFacet</str>
>      <str name="facet.field">divProductTypeIdFacet</str>
>    </lst>
>    <lst name="appends">
>    </lst>
>    <lst name="invariants">
>    </lst>
>  </requestHandler>
>
>
>
> // analysis output from debugQuery=on
>
> here you can see that the top socre for itemNo:9030 is a part that does not
> start with 9030.
>
> the entries below (there are 4) all have exact matches - but they rank
> below
> this part - ???
>
>
>
> <str name="0904000,1354  ,<b>2TTZ9030C1000A*                     ">
> 0.585678 = (MATCH) max of:
>  0.585678 = (MATCH) weight(itemNo:9030^0.9 in 582979), product of:
>    0.021552926 = queryWeight(itemNo:9030^0.9), product of:
>      0.9 = boost
>      10.270785 = idf(docFreq=55, maxDocs=594893)
>      0.0023316324 = queryNorm
>    27.173943 = (MATCH) fieldWeight(itemNo:9030 in 582979), product of:
>      2.6457512 = tf(termFreq(itemNo:9030)=7)
>      10.270785 = idf(docFreq=55, maxDocs=594893)
>      1.0 = fieldNorm(field=itemNo, doc=582979)
> </str>
>
>
>
> <str name="1220000,1232  ,<b>9030*                               ">
> 0.22136548 = (MATCH) max of:
>  0.22136548 = (MATCH) weight(itemNo:9030^0.9 in 499864), product of:
>    0.021552926 = queryWeight(itemNo:9030^0.9), product of:
>      0.9 = boost
>      10.270785 = idf(docFreq=55, maxDocs=594893)
>      0.0023316324 = queryNorm
>    10.270785 = (MATCH) fieldWeight(itemNo:9030 in 499864), product of:
>      1.0 = tf(termFreq(itemNo:9030)=1)
>      10.270785 = idf(docFreq=55, maxDocs=594893)
>      1.0 = fieldNorm(field=itemNo, doc=499864)
> </str>
>
> <str name="0537220,1882  ,<b>9030                               *">
> 0.22136548 = (MATCH) max of:
>  0.22136548 = (MATCH) weight(itemNo:9030^0.9 in 538826), product of:
>    0.021552926 = queryWeight(itemNo:9030^0.9), product of:
>      0.9 = boost
>      10.270785 = idf(docFreq=55, maxDocs=594893)
>      0.0023316324 = queryNorm
>    10.270785 = (MATCH) fieldWeight(itemNo:9030 in 538826), product of:
>      1.0 = tf(termFreq(itemNo:9030)=1)
>      10.270785 = idf(docFreq=55, maxDocs=594893)
>      1.0 = fieldNorm(field=itemNo, doc=538826)
> </str>
>
> <str name="0537220,2123  ,<b>9030                               *">
> 0.22136548 = (MATCH) max of:
>  0.22136548 = (MATCH) weight(itemNo:9030^0.9 in 544313), product of:
>    0.021552926 = queryWeight(itemNo:9030^0.9), product of:
>      0.9 = boost
>      10.270785 = idf(docFreq=55, maxDocs=594893)
>      0.0023316324 = queryNorm
>    10.270785 = (MATCH) fieldWeight(itemNo:9030 in 544313), product of:
>      1.0 = tf(termFreq(itemNo:9030)=1)
>      10.270785 = idf(docFreq=55, maxDocs=594893)
>      1.0 = fieldNorm(field=itemNo, doc=544313)
> </str>
>
> <str name="0537220,2087  ,<b>9030                               *">
> 0.22136548 = (MATCH) max of:
>  0.22136548 = (MATCH) weight(itemNo:9030^0.9 in 544657), product of:
>    0.021552926 = queryWeight(itemNo:9030^0.9), product of:
>      0.9 = boost
>      10.270785 = idf(docFreq=55, maxDocs=594893)
>      0.0023316324 = queryNorm
>    10.270785 = (MATCH) fieldWeight(itemNo:9030 in 544657), product of:
>      1.0 = tf(termFreq(itemNo:9030)=1)
>      10.270785 = idf(docFreq=55, maxDocs=594893)
>      1.0 = fieldNorm(field=itemNo, doc=544657)
> </str>
>
>
>
>
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/need-help-with-getting-exact-matches-to-score-higher-tp3983882.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>