Azure Search scoring -
i have sets of 3 identical (in text) items in azure search varying on price , points. cheaper products higher points boosted higher. (price boosted more points, , boosted inversely).
however, keep seeing search results similar this.
search on ‘john milton’.
i
product="id = 2-462109171829-1, price=116.57, points= 7, name=life of schamyl / john milton mackie, description=.", score=32.499783 product="id = 2-462109171829-2, price=116.40, points= 9, name=life of schamyl / john milton mackie, description=.", score=32.454872 product="id = 2-462109171829-3, price=115.64, points= 9, name=life of schamyl / john milton mackie, description=.", score=32.316270
i expect scoring order this, lowest price first.
product="id = 2-462109171829-3, price=115.64, points= 9, name=life of schamyl / john milton mackie, description=.", score= product="id = 2-462109171829-2, price=116.40, points= 9, name=life of schamyl / john milton mackie, description=.", score= product="id = 2-462109171829-1, price=116.57, points= 7, name=life of schamyl / john milton mackie, description=.", score=
what missing or minor scoring variations acceptable?
the index defined
let productdataindex = let fields = [| new field ( "id", datatype.string, iskey = true, issearchable = true); new field ( "culture", datatype.string, issearchable = true); new field ( "gran", datatype.string, issearchable = true); new field ( "name", datatype.string, issearchable = true); new field ( "description", datatype.string, issearchable = true); new field ( "price", datatype.double, issortable = true, isfilterable = true) new field ( "points", datatype.int32, issortable = true, isfilterable = true) |] let weightstext = new textweights( weights = ([| ("name", 4.); ("description", 2.) |] |> dict)) let priceboost = new magnitudescoringfunction( new magnitudescoringparameters( boostingrangestart = 1000.0, boostingrangeend = 0.0, shouldboostbeyondrangebyconstant = true), "price", 10.0) let pointsboost = new magnitudescoringfunction( new magnitudescoringparameters( boostingrangestart = 0.0, boostingrangeend = 10000000.0, shouldboostbeyondrangebyconstant = true), "points", 2.0) let scoringprofilemain = new scoringprofile ( "main", textweights = weightstext, functions = new list<scoringfunction>( [ priceboost :> scoringfunction pointsboost :> scoringfunction ]), functionaggregation = scoringfunctionaggregation.sum) new index (name = productindexname ,fields = fields ,scoringprofiles = new list<scoringprofile>( [ scoringprofilemain ]))
all indexes in azure search split multiple shards allowing quick scale , scale downs. when search request issued, it’s issued against each of shards independently. result sets each of shards merged , ordered score (if no other ordering defined). it important know scoring function weights query term frequency in each document against frequency in documents, in shard!
it means in scenario, in have 3 instances of every document, scoring profiles disabled, if 1 of documents lands on different shard other two, score different. more data in index, smaller differences (more term distribution). it’s not possible assume on shard given document placed.
in general, document score not best attribute ordering documents. should give general sense of document relevance against other documents in results set. in scenario, possible order results price and/or points if marked price and/or points fields sortable. can find more information how use $orderby query parameter here: https://msdn.microsoft.com/en-us/library/azure/dn798927.aspx