Functional Boosts
Engine Type | Supported? |
---|---|
Crawler-based Engine | YES |
API-based Engine | YES |
Functional boosts increase result scores based on the value of an integer
or float
field.
There are 3 types of functional boosts:
Boost Type | Description |
---|---|
logarithmic | Multiplies the original score by ln(field value) |
exponential | Multiplies the original score by efield value |
linear | Multiplies the original score by field value |
- q
- required
- The query used within your search.
- engine_key
- required
- The Engine Key associated with your Engine. Found within your dashboard.
- functional_boosts
- optional
- Values can be
logarithmic
,exponential
, orlinear
. See the above table for more information.
Example - Return the most popular results from the
books
DocumentType, but first boost the total_purchases
field with a logarithmic
boost. Crawler based Engines use page
as the default DocumentType.
curl -XGET 'https://search-api.swiftype.com/api/v1/public/engines/search.json' \
-H 'Content-Type: application/json' \
-d '{
"engine_key": "YOUR_ENGINE_KEY",
"q": "brothers",
"functional_boosts":{
"books":{
"total_purchases":"logarithmic"
}
}
}'
Supported Field Types
Type | Boosting |
---|---|
string |
No |
text |
No |
enum |
No |
integer |
Yes |
float |
Yes |
date |
No |
location |
No |
Stuck? Looking for help? Contact support or check out the Site Search community forum!