mercredi 23 mai 2018

solr search sort by rand within same score

I am using solr 6.3 i want to sort documents by rand within the same scores

Please see the result response

"response":{"numFound":9796,"start":0,"maxScore":4.813048,"docs":[

  {
    "product_slno":"8343676",
    "product_name":"non basmati rice",
    "score":4.813048},
  {
    "product_slno":"9272399",
    "product_name":"non basmati rice",
    "score":4.813048},
  {
    "product_slno":"9117918",
    "product_name":"non basmati rice",
    "score":4.813048},
  {
    "product_slno":"11992571",
    "product_name":"non basmati rice",
    "score":4.813048},
  {
    "product_slno":"12226220",
    "product_name":"non basmati rice",
    "score":4.813048},
  {
    "product_slno":"12239015",
    "product_name":"non basmati rice",
    "score":4.813048},
  {
    "product_slno":"228513",
    "product_name":"basmati rice",
    "score":4.6070313},
  {
    "product_slno":"382382",
    "product_name":"basmati rice",
    "score":4.6070313},
  {
    "product_slno":"591419",
    "product_name":"basmati rice",
    "score":4.6070313},
  {
    "product_slno":"11992574",
    "product_name":"basmati rice",
    "score":4.6070313},
  {
    "product_slno":"12067342",
    "product_name":"basmati rice",
    "score":4.6070313},
  {
    "product_slno":"12102172",
    "product_name":"basmati rice",
    "score":4.6070313},
  {
    "product_slno":"12116777",
    "product_name":"basmati rice",
    "score":4.6070313},
  {
    "product_slno":"12125565",
    "product_name":"basmati rice",
    "score":4.6070313},
  {
    "product_slno":"4462552",
    "product_name":"non basmati rice",
    "score":4.424822},
  {
    "product_slno":"6666626",
    "product_name":"non basmati rice",
    "score":4.424822},
  {
    "product_slno":"7036941",
    "product_name":"non basmati rice",
    "score":4.424822},
  {
    "product_slno":"7833234",
    "product_name":"non basmati rice",
    "score":4.424822},
  {
    "product_slno":"7552192",
    "product_name":"non basmati rice",
    "score":4.424822},
  {
    "product_slno":"8757321",
    "product_name":"non basmati rice",
    "score":4.424822},
  {
    "product_slno":"9207159",
    "product_name":"non basmati rice",
    "score":4.424822},
  {
    "product_slno":"9978281",
    "product_name":"non basmati rice",
    "score":4.424822},
  {
    "product_slno":"11642035",
    "product_name":"non basmati rice",
    "score":4.424822},
  {
    "product_slno":"12294941",
    "product_name":"non basmati rice",
    "score":4.424822},
  {
    "product_slno":"12313470",
    "product_name":"non-basmati rice",
    "score":4.424822},
  {
    "product_slno":"5457576",
    "product_name":"basmati rice",
    "score":4.2188053},
  {
    "product_slno":"6666629",
    "product_name":"basmati rice",
    "score":4.2188053},
  {
    "product_slno":"7552189",
    "product_name":"basmati rice",
    "score":4.2188053},
  {
    "product_slno":"11476797",
    "product_name":"basmati rice",
    "score":4.2188053},
  {
    "product_slno":"11642034",
    "product_name":"basmati rice",
    "score":4.2188053},
  {
    "product_slno":"12209560",
    "product_name":"basmati rice",
    "score":4.2188053},
  {
    "product_slno":"12230206",
    "product_name":"basmati rice",
    "score":4.2188053},
  {
    "product_slno":"12233053",
    "product_name":"basmati rice",
    "score":4.2188053},
  {
    "product_slno":"182609",
    "product_name":"non basmati rice",
    "score":1.7452564},
  {
    "product_slno":"158848",
    "product_name":"non basmati parboiled rice",
    "score":1.7452564},
  {
    "product_slno":"8439880",
    "product_name":"non basmati rice",
    "score":1.7452564},
  {
    "product_slno":"10035413",
    "product_name":"non basmati rice",
    "score":1.7452564},

we have multiple documents for scores "4.813048" ,"4.6070313", "4.424822", "4.2188053", "1.7452564" i want random sort within same scores.

thanks




Aucun commentaire:

Enregistrer un commentaire