I am trying to use scoring to get the expected results at the top of the
stack when doing a Solr query.

I am looking up clt_ref_no: OWL-2924-8^2 OR contract_number: OWL-2924-8^2

If I use the following query:in the browser, I get the expected results at
the top of the returned values from Solr.

{
  "responseHeader":{
    "status":0,
    "QTime":41,
    "params":{
      "q":"( clt_ref_no:OWL-2924-8 ^2 OR contract_number:OWL-2924-8^2 )",
      "indent":"on",
      "fl":"clt_ref_no, score",
      "rows":"1000"}},
  "response":{"numFound":84663,"start":0,"maxScore":25.664566,"docs":[
      {
        "clt_ref_no":"OWL-2924-8",
        "score":25.664566},
      {
        "clt_ref_no":"OWL-2924-8",
        "score":25.664566},
      {
        "clt_ref_no":"OWL-2924-8/73847",
        "score":23.509575},
      {
        "clt_ref_no":"OWL-2924-8/73847",
        "score":23.509575},
      {
        "clt_ref_no":"OWL-2924-8/73847",
        "score":23.509575},
      {
        "clt_ref_no":"U615-2924-8",
        "score":19.244316},
      {
        "clt_ref_no":"M1057-2924-8/88543",
        "score":17.650301},

If I add ihe sorting needed for cursor, my results change
dramatically, and the exact matches are not at the top of the stack.

Example:



{
  "responseHeader":{
    "status":0,
    "QTime":80,
    "params":{
      "q":"( clt_ref_no:OWL-2924-8 ^2 OR contract_number:OWL-2924-8^2 )",
      "indent":"on",
      "fl":"clt_ref_no, score",
      "sort":"score asc, id asc",
      "rows":"1000"}},
  "response":{"numFound":84663,"start":0,"maxScore":25.664566,"docs":[
      {
        "clt_ref_no":"MMRO-1258-13/MMRO-1258-13/8",
        "score":1.3380225},
      {
        "clt_ref_no":"MMMP-151-14/MMMP-151-14/8",
        "score":1.3380225},
      {
        "clt_ref_no":"MMRO-806-14/MMRO-806-14/8",
        "score":1.3380225},
      {
        "clt_ref_no":"MMMP-44-14/MMMP-44-14/8",
        "score":1.3380225},
      {
        "clt_ref_no":"MMRO-45-13/MMRO-45-13/8",
        "score":1.3380225},
      {
        "clt_ref_no":"MMIN-202-14/MMIN-202-14/8",
        "score":1.3380225},
      {
        "clt_ref_no":"MMTC-1457-14/MMTC-1457-14/8",
        "score":1.3380225},
      {

Should I not be sorting on score? I thought sorting on score was how I
would get the exact matches to return?

If I add in sort=score asc to the first query, it does what the second
query does, and not have expected matches floating to the top of the
results.

Thanks,

Rhys

Reply via email to