JavaScript
How scoring is calculated
Filter scores are integer values from 0 to 65,535.Default scoring
In the preceding example, any portfolio containing all three companies (Google, Amazon, and Facebook) would score3, as the overall score is based on the highest score. In other words, by default, there is no accumulation of individual scores.
Accumulating scores with sumOrFiltersScores
You accumulate scores by setting thesumOrFiltersScores parameter to true. In the preceding example, any record with all three companies would have an overall score of 6 (3+2+1).
If sumOrFiltersScores is false, the default, the system uses the default scoring method: taking the highest score. Using the preceding example and a query filtered on Google and Amazon with sumOrFiltersScores = false returns a score of 3 (google(3) > amazon(2) > facebook(1)).
JavaScript
sumOrFiltersScores = true returns a score of 6 (google (3) + amazon(2) + facebook(1)).
JavaScript
Scoring ANDs and ORs
Use theOR operator when you want to weigh terms differently.
- When filtering with
OR, the overall score is based on the individualtruevalue scores. If you have three filter values in your query and all three match, it will have a higher score than another record that matches only one filter value. - Filtering only with ANDs removes the effect of scoring. With a group of ANDs, records are only chosen if all filters match: all records will have the same score.
Scoring using numeric filters
You canβt apply scores with numeric filters (like>=, !=, >).
Scoring can only be done on facet values using the attribute:value<score=X> syntax.