0

I am trying to get sorted document set in response according to associated piped weight in multivalued field in solr 5.5.0 payload , but when I used debugQuery=true I am getting scores of all documents same irrespective of associated weights

http://localhost:8983/solr/catalog/select?q=payloads%3AABC&wt=json&indent=true&debugQuery=true

{  
  "responseHeader":{  
    "status":0,
    "QTime":5
  },
  "response":{  
    "numFound":8,
    "start":0,
    "docs":[  
      {  
        "id":"NOK5",
        "name":"One Krone",
        "manu_id_s":"nor",
        "price_c":"1,NOK",
        "payloads":[  
          "ABC|110.0"
        ],
        "_version_":1549328956822388700,
        "last_updated":"2016-10-27T08:00:33.785Z"
      },
      {  
        "id":"NOK4",
        "name":"One Krone",
        "manu_id_s":"nor",
        "price_c":"1,NOK",
        "payloads":[  
          "ABC|90.0"
        ],
        "_version_":1549328945950752800,
        "last_updated":"2016-10-27T08:00:23.417Z"
      },
      ...
    ]
  },
  "debug":{  
    "rawquerystring":"payloads:ABC",
    "querystring":"payloads:ABC",
    "parsedquery":"payloads:ABC",
    "parsedquery_toString":"payloads:ABC",
    "explain":{  
      "NOK5":" 52.870323 = weight(payloads:ABC in 1) [], result of: 52.870323 = score(doc=1,freq=1.0), product of: 7.2711983 = queryWeight, product of: 7.2711983 = idf(docFreq=8, maxDocs=4762) 1.0 = queryNorm 7.2711983 = fieldWeight in 1, product of: 1.0 = tf(freq=1.0), with freq of: 1.0 = termFreq=1.0 7.2711983 = idf(docFreq=8, maxDocs=4762) 1.0 = fieldNorm(doc=1) ",
      "NOK4":" 52.870323 = weight(payloads:ABC in 1) [], result of: 52.870323 = score(doc=1,freq=1.0), product of: 7.2711983 = queryWeight, product of: 7.2711983 = idf(docFreq=8, maxDocs=4762) 1.0 = queryNorm 7.2711983 = fieldWeight in 1, product of: 1.0 = tf(freq=1.0), with freq of: 1.0 = termFreq=1.0 7.2711983 = idf(docFreq=8, maxDocs=4762) 1.0 = fieldNorm(doc=1) ",
      "NOK150":" 52.870323 = weight(payloads:ABC in 0) [], result of: 52.870323 = score(doc=0,freq=1.0), product of: 7.2711983 = queryWeight, product of: 7.2711983 = idf(docFreq=8, maxDocs=4762) 1.0 = queryNorm 7.2711983 = fieldWeight in 0, product of: 1.0 = tf(freq=1.0), with freq of: 1.0 = termFreq=1.0 7.2711983 = idf(docFreq=8, maxDocs=4762) 1.0 = fieldNorm(doc=0) ",
      "NOK3":" 52.870323 = weight(payloads:ABC in 1) [], result of: 52.870323 = score(doc=1,freq=1.0), product of: 7.2711983 = queryWeight, product of: 7.2711983 = idf(docFreq=8, maxDocs=4762) 1.0 = queryNorm 7.2711983 = fieldWeight in 1, product of: 1.0 = tf(freq=1.0), with freq of: 1.0 = termFreq=1.0 7.2711983 = idf(docFreq=8, maxDocs=4762) 1.0 = fieldNorm(doc=1) ",
      "NOK7":" 52.870323 = weight(payloads:ABC in 2) [], result of: 52.870323 = score(doc=2,freq=1.0), product of: 7.2711983 = queryWeight, product of: 7.2711983 = idf(docFreq=8, maxDocs=4762) 1.0 = queryNorm 7.2711983 = fieldWeight in 2, product of: 1.0 = tf(freq=1.0), with freq of: 1.0 = termFreq=1.0 7.2711983 = idf(docFreq=8, maxDocs=4762) 1.0 = fieldNorm(doc=2) ",
      "NOK1":" 52.870323 = weight(payloads:ABC in 0) [], result of: 52.870323 = score(doc=0,freq=1.0), product of: 7.2711983 = queryWeight, product of: 7.2711983 = idf(docFreq=8, maxDocs=4762) 1.0 = queryNorm 7.2711983 = fieldWeight in 0, product of: 1.0 = tf(freq=1.0), with freq of: 1.0 = termFreq=1.0 7.2711983 = idf(docFreq=8, maxDocs=4762) 1.0 = fieldNorm(doc=0) ",
      "NOK2":" 52.870323 = weight(payloads:ABC in 1) [], result of: 52.870323 = score(doc=1,freq=1.0), product of: 7.2711983 = queryWeight, product of: 7.2711983 = idf(docFreq=8, maxDocs=4762) 1.0 = queryNorm 7.2711983 = fieldWeight in 1, product of: 1.0 = tf(freq=1.0), with freq of: 1.0 = termFreq=1.0 7.2711983 = idf(docFreq=8, maxDocs=4762) 1.0 = fieldNorm(doc=1) ",
      "NOK6":" 52.870323 = weight(payloads:ABC in 2) [], result of: 52.870323 = score(doc=2,freq=1.0), product of: 7.2711983 = queryWeight, product of: 7.2711983 = idf(docFreq=8, maxDocs=4762) 1.0 = queryNorm 7.2711983 = fieldWeight in 2, product of: 1.0 = tf(freq=1.0), with freq of: 1.0 = termFreq=1.0 7.2711983 = idf(docFreq=8, maxDocs=4762) 1.0 = fieldNorm(doc=2) "
    },
    "QParser":"LuceneQParser",
    "timing":{  
      ...
    }
  }
}

Can someone please help.

MatsLindh
  • 49,529
  • 4
  • 53
  • 84
  • Have you written a custom similarity class to use your payloads? What is the definition of the "payloads" field? – MatsLindh Oct 27 '16 at 09:32
  • @MatsLindh - yes I have written Custom class to override ClassicSimilarityFactory . My custom class which is extending ClassicSimilarityFactory is - http://pastebin.com/MYZmqGLM – NikhilAgrawal Oct 27 '16 at 09:50
  • So is the similarity class actually invoked? Remember that you also have to have the payload filter with the encoder in the field type. Depending on what you want to use the value for, you can also add it to the index by itself and then use `boost=` to allow the value to affect the score in custom ways (or use sort directly). – MatsLindh Oct 27 '16 at 09:54
  • Yes. PayloadSimilarityFactory is the class to invoke. In my schema.xml I am using like this Consider weight after ABC pipe . Is boost = is correct way. I am really new to Solr – NikhilAgrawal Oct 27 '16 at 10:04
  • The correct way depends on what you're trying to achieve - it's usually easier to build something using boost or sort, since those parameters doesn't require custom code. But is your class being invoked (are the log statements being run)? We should probably move this to chat instead of the comments. – MatsLindh Oct 27 '16 at 10:09
  • My problem statement is this - http://stackoverflow.com/questions/20177913/adding-boost-to-score-according-to-payload-of-multivalued-field-at-solr . I want to implement in solr 5.5.0 – NikhilAgrawal Oct 27 '16 at 12:03
  • Logs inside PayloadSimilarityFactory class are printing but PayloadSimilarity class which is called from PayloadSimilarityFactory class does not print any logs of function scorePayload. Can you please help. – NikhilAgrawal Oct 28 '16 at 06:07
  • I am not able to move this into chat . Can you mail me ur email id to nikhil.agrwl07@gmail.com – NikhilAgrawal Oct 28 '16 at 06:08

0 Answers0