![]() You would like the query results that match your criterion (forĮxample, "hotel, Nancy, non-smoker") to be scored with respect toĭistance to the town center and also the price. So the farther the hotel is from the desired location the less likely Also, you would like the hotel to be close to the town center, Suppose you are searching for a hotel in a certain town. In the second example, documents with a field value between -22 would get a weight of 1.0 and documents which are 15 days from that date a weight of 0.5. The score function computes a score of 0.33 for hotels that are 2km away The parameter "scale" will then be adjusted automatically to assure that Like: "At a distance of 2km from the desired location, the score should What scale to choose for the gauss function, but you can say something You want to compute a decay function depending on howįar the hotel is from a given location. In the first example, your documents might represents hotels and contain a geo If no decay is defined, documents at the distance The decay parameter defines how documents are scored at the distance If an offset is defined, the decay function will only compute theĭecay function for documents with a distance greater than the defined For date fields: Can to be defined as a number+unit ("1h", "10d",…).ĭefault unit is milliseconds. For geo fields: Can be defined as number+unit (1km, 12m,…).ĭefault unit is meters. Defines the distance from origin + offset at which the computed Math (for example now-1h) is supported for origin. Number for numeric field, date for date fields and geo point for geo fields. The point of origin used for calculating distance. Is updated since update operations also update the value of the _seq_no field. _seq_no field, whose only drawback is that scores will change if the document A good default choice might be to use the Will however get the same score, so it is usually desirable to use a field that Note thatĭocuments that are within the same shard and have the same value for field Value but are stored in different indexes get different scores. Minimum value of field for the considered document and a salt that is computedīased on the index name and shard id so that documents that have the same The final score will then be computed based on this seed, the In case you want scores to be reproducible, it is possible to provide a seedĪnd field. Reproducible since documents might be renumbered by merges. Source of randomness, which is very efficient but unfortunately not By default, it uses the internal Lucene doc ids as a The random_score generates scores that are uniformly distributed from 0 up toīut not including 1. The newly computed score is combined with the score of the The new score can be restricted to not exceed a certain limit by setting In case score_mode is set to avg the individual scores will be combined by a weighted average.įor example, if two functions return score 1 and 2 and their respective weights are 3 and 4, then their scores will be combined as ![]() If weight is given without any other function declaration, weight acts as a function that simply returns the weight. ![]() The weight can be defined per function in the functions array (example above) and is multiplied with the score computed by The first function that has a matching filterīecause scores can be on different scales (for example, between 0 and 1 for decay functions but arbitrary for field_value_factor) and alsoīecause sometimes a different impact of functions on the score is desirable, the score of each function can be adjusted with a user defined
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |