1

I'm used Solr 6.1,

I need customized the score in every result,

this is Original result:

    [
      {
        "_id": "59d2face138d070c14fccd0d",
        "plusrnak": 44.623055,
        "score": 80.439298
      },
      {
        "_id": "59d2face384eb78b23f60d78",
        "plusrnak": 36.508239,
        "score": 62.644288
      },
      {
        "_id": "59d2face70750b413d839136",
        "plusrnak": 80.446665,
        "score": 44.639681
      },
      {
        "_id": "59d2facee507560951445e3d",
        "plusrnak": 60.84082,
        "score": 38.997843
      },
      {
        "_id": "59d2face415b1ba891dfbb97",
        "plusrnak": 6.225893,
        "score": 38.279674
      },
      {
        "_id": "59d2facec792d7ff7ade6620",
        "plusrnak": 76.954612,
        "score": 23.405887
      },
      {
        "_id": "59d2face6958596fce9baa9a",
        "plusrnak": 5.903754,
        "score": 1.864721
      }
    ]

I want to plus field "plusrnak" values in every score

Like this :

    [
      {
        "_id": "59d2face70750b413d839136",
        "plusrnak": 80.446665,
        "score": 125.086346
      },
      {
        "_id": "59d2face138d070c14fccd0d",
        "plusrnak": 44.623055,
        "score": 125.062353
      },
      {
        "_id": "59d2facec792d7ff7ade6620",
        "plusrnak": 76.954612,
        "score": 100.360499
      },
      {
        "_id": "59d2facee507560951445e3d",
        "plusrnak": 60.84082,
        "score": 99.838663
      },
      {
        "_id": "59d2face384eb78b23f60d78",
        "plusrnak": 36.508239,
        "score": 99.152527
      },
      {
        "_id": "59d2face415b1ba891dfbb97",
        "plusrnak": 6.225893,
        "score": 44.505567
      },

      {
        "_id": "59d2face6958596fce9baa9a",
        "plusrnak": 5.903754,
        "score": 7.768475
      }
    ]

how to do it? and can i setting this on config file? how?

Or can I use "plusrnak" field replace score? if is null or empty it just use original score? how to do that?

ZivHus
  • 67
  • 1
  • 11
  • The `bq` and `bf` parameters in dismax are additive boosts, so you could try `bf=plusrnak` and look at the how scores are calcualted in `debugQuery`. The behavior might be slightly different with edismax. – MatsLindh Oct 03 '17 at 08:43
  • @MatsLindh thanks this make me help, and i have another one issue here https://stackoverflow.com/questions/46581017/solr-score-key-word-detection-rate did you know why? and how to fixed? – ZivHus Oct 05 '17 at 08:26

1 Answers1

0

This old blog post is actually quite nice and explicative.[1] I normally discourage additive boosts, as you are adding values on a possibly different scale ( the lucene score is not normalised and will vary from query to query, and with the corpus changes).

In case you still want additive boost : using dismax ( or edismax) and this request parameter : bf= plusrnak

From the Solr wiki :

field

Returns the numeric docValues or indexed value of the field with the specified name. In its simplest (single argument) form, this function can only be used on single valued fields, and can be called using the name of the field as a string, or for most conventional field names simply use the field name by itself with out using the field(…​) syntax.

When using docValues, an optional 2nd argument can be specified to select the “min"or "max” value of multivalued fields.

0 is returned for documents without a value in the field.

more details follow[2]

[1] https://nolanlawson.com/2012/06/02/comparing-boost-methods-in-solr/

[2] https://lucene.apache.org/solr/guide/6_6/function-queries.html#FunctionQueries-AvailableFunctions