Field Weights
| Engine Type | Supported? |
|---|---|
| Crawler-based Engine | YES |
| API-based Engine | YES |
Apply weights to different fields to control how each field affects the result rankings.
Weight is measured between 1-10, with 10 being the most heavily weighed.
Field weight set at query time will take precedence over field weights defined in the dashboard.
Apply weights to numeric fields with Functional Boosts.
Example - Return books matching the query "brothers" from the
books DocumentType and weight matches in the title field three times as highly as matches in the author field. Crawler based Engines use page as the default DocumentType.
curl -X GET 'https://search-api.swiftype.com/api/v1/public/engines/search.json' \
-H 'Content-Type: application/json' \
-d '{
"engine_key": "YOUR_ENGINE_KEY",
"q": "brothers",
"search_fields":{
"books":["title^3","author"]
}
}'
Stuck? Looking for help? Contact support or check out the Site Search community forum!