The Ranking interface
You can override or update a widget's configuration at runtime. You do this in the search request itself. Various rules are driven by the attributes of the entity in the request.
This topic describes the interface of the object used at runtime to rank attributes during a search.
Ranking interface
|
Property |
Type |
Description |
|---|---|---|
|
|
string |
Required. Name of the attribute to use for ranking. You must mark the attribute for search ranking in Sitecore Search by clicking Administration > Domain Settings > Attribute > Use For Features. |
|
|
number |
Weight to apply to this ranking attribute. The default is 1.0. You can enter any value between 1 and 100, but we recommend that you pass a low value to minimize the impact of a single component on the overall scoring system. If you rank by a timestamp attribute such as
For example, you send a request on Friday, May 26 at 1:30pm with a ranking weight of 3. A content item whose |
When you use a timestamp attribute for ranking, the ranking boost only applies to content whose timestamp is within 7 days of the query time.To rank content by recency, store the date as an integer attribute containing the Unix epoch value. Because more recent dates have larger numeric values, ranking can favor newer content over older content.
Unless indicated otherwise, all values are optional.