- DotNET Client API
- Client class
- Deleting documents
- File attachments
- Getting documents
- Inheritance and interfaces
- References and configuration
- Customizing serialization
- Auto Boosting
- Best Bets
- Boosting with filters
- Boosting with weights
- External content
- Free text search
- Geo Search
- Including documents matching a filter
- More Like/Related
- Multiple searches in one request
- Pagination (Skip and Take)
- Related Queries
- Searching over multiple types
- Unified search
- EPiServer 7/7.5 CMS
- EPiServer 7.5+
- EPiServer CMS 6 R2
- Shell module
- REST API
- Search statistics
This content is archived. See latest version here
Last updated: Oct 16 2014
By default, search results are sorted according to score (relevance). In some applications, boosting the score using the document age or popularity (tracked hit count) can make the sorting of the results more relevant. Searching using auto boosting is one way to achieve this. Auto boosting uses document hit count (hit boost) and age (decay) as measurements to determine boost.
Search using Auto Boosting
The below code increases the probability that new and popular blog posts about the fruit "banana" are sorted first in the search results.
C# searchResult = client.Search<BlogPost>() .For("Banana") .UsingAutoBoost(TimeSpan.FromDays(14)) .GetResult();
- decayScale - TimeSpan (required)
- decayOffset - TimeSpan (optional)
- decayShape - double (optional)
- decayMinimum - double (optional)
- decayOrigin - DateTime (optional)
- hitBoostScale - double (optional)
- hitBoostOffset - double (optional)
Use Hit Boost to boost the score of frequent hits. For a document, this is calculated as the inverted exponential decay based on the ratio between the tracked hit count and the total tracked hit count for the entire index. The hit boost ranges between 1.0 and 2.0. Hit boost requires tracking.
You can control the rapidity of the decay by setting the hitBoostScale parameter, which sets the half-life. So, if the boost is at 50%, by default this is set to 0.1 (10%). Lowering the scale makes the inverted decay more rapid. Setting a value higher than 0.1 leads to cut-off, where the hit boost cannot reach the upper range limit.
You can use the hitBoostOffset parameter to ignore documents with few hits. By default this is set to 0.0, where no documents are ignored. Since the influence of hit counts is very slight in most indexes, the offset should normally stay at zero or a very small number. Setting the offset to 1.0 essentially turns off the hit boost.
Decay is used to boost the score of recently-viewed documents. For a document, this is calculated as the exponential (Weibull) decay based on the distance between a date value associated with a document and a fixed point in time. Normally, the date value is the document age or updated date value, and the fixed point in time is the time of the search. A date value at, or after, the fixed point in time gets a boost of 1.0, while a date value before the fixed point in time nears a minimum value (by default 0.2).
Like hit boost, you can control the decay half-life by setting the decayScale parameter. For decay, this parameter is required since the scale is highly application-dependent and has no sensible default value. The scale is set as a time span value.
Another way to affect the decay is to set the decayShape parameter. This is equivalent to setting the k-value in the Weibull cumulative distribution that is used for calculating decay in auto boosting. By default, the shape is set to 1.0, which makes it equivalent to exponential decay. The shape can range from more rapid decay (k < 1.0) to more sigmoidal decay (k > 1.0).
Decay is measured from a fixed point in time that can be set using the decayOrigin parameter. By default this is set to the time of the request. All dates after the origin are limited.
A grace period for documents near the origin can be set using the decayOffset parameter. No decay is applied within the grace period, and the decay starts immediately after. The offset is set as a time span value.
You can use the minimum value to modify the decay's dynamic range by setting the decayMinimum parameter from 0.0 (full range) to 1.0 (no range). Setting the minimum to 1.0 essentially turns off the decay. If a date value cannot be determined, the decay defaults to the middle of the decay range, by default 0.6.
Use the attached Excel spreadsheet example to simulate auto boosting effects.