- App Search Guide: other versions:
- Installation
- Getting started
- Authentication
- Limits
- Users and access
- Guides
- Adaptive relevance events logs reference
- Analytics Tags
- Crawl web content
- Crawl a private network using a web crawler on Elastic Cloud
- Curations
- Facets
- Hierarchical Facets
- Indexing Documents
- Language Optimization
- Log settings
- Meta Engines
- Precision tuning (beta)
- Query Suggestions
- Search UI
- Relevance Tuning
- Result Settings
- Result Suggestions
- Role based access control (RBAC)
- Sanitization, Raw or Snippet
- Search
- Synonyms
- View web crawler events logs
- Web crawler
- Web crawler FAQ
- Web crawler reference
- Web crawler events logs reference
- API Reference
- Adaptive relevance API reference (beta)
- Analytics APIs
- Analytics clicks API
- Analytics counts API
- Analytics queries API
- API logs API
- Click API
- Credentials API
- Curations API reference
- Documents API
- Engines API
- Log settings API
- Multi search API
- Query suggestion API
- Schema API
- Search API
- Search API boosts
- Search API facets
- Search API filters
- Search API group
- Search API precision (beta)
- Search API result fields
- Search API search fields
- Search API sort
- Search API analytics tags
- Search settings API
- Source engines API
- Synonyms API
- Web crawler API (beta) reference
- API Clients
- Configuration
- Troubleshooting
Search settings API
editSearch settings API
editUse the search settings API to set engine defaults for the following search API request parameters:
Each query sent to an engine will use these default parameters, unless they are overridden directly within the query.
The changes you make to result_fields
through this API will affect those shown within the Result Settings UI.
Requires a Private API Key.
Show search settings
editShow the search settings for a given engine.
GET /api/as/v1/engines/{ENGINE_NAME}/search_settings
Example - A GET
request to national-parks-demo
:
curl -X GET 'https://[instance id].ent-search.[region].[provider].cloud.es.io:443/api/as/v1/engines/national-parks-demo/search_settings' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer private-xxxxxxxxxxxxxxxx'
Example response:
{ "search_fields": { "description": { "weight": 1 }, "nps_link": { "weight": 1 }, "states": { "weight": 1 }, "title": { "weight": 3 }, "world_heritage_site": { "weight": 1 }, "id": { "weight": 1 } }, "result_fields": { "id": { "raw": {} }, "description": { "raw": {} }, "nps_link": { "raw": {} }, "states": { "raw": {} }, "title": { "raw": {} }, "visitors": { "raw": {} }, "world_heritage_site": { "raw": {} }, "location": { "raw": {} }, "acres": { "raw": {} }, "square_km": { "raw": {} }, "date_established": { "raw": {} } }, "boosts": {}, "precision": 2 }
Update search settings
editUpdate the search settings for a given engine.
Removing fields from result_fields
means that those fields are not returned in results.
PUT /api/as/v1/engines/{ENGINE_NAME}/search_settings
Example - A PUT
request to national-parks-demo
.
This example selects which fields to search, calibrates field weights, boosts specific field values, and tunes precision.
Responses for this example return only the "title", "description", and "states" fields, with snippets.
curl -X PUT 'https://[instance id].ent-search.[region].[provider].cloud.es.io:443/api/as/v1/engines/national-parks-demo/search_settings' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer private-xxxxxxxxxxxxxxxx' \ -d '{ "search_fields": { "description": { "weight": 9.2 }, "nps_link": { "weight": 1 }, "states": { "weight": 3 }, "title": { "weight": 1 }, "world_heritage_site": { "weight": 1 }, "id": { "weight": 1 } }, "result_fields": { "title": { "snippet": { "size": 20, "fallback": true } }, "description": { "raw": { "size": 200 }, "snippet": { "size": 100 } }, "states": { "raw" : {}, "snippet": { "size": 20, "fallback": true } } }, "boosts": { "world_heritage_site": [ { "type": "value", "factor": 9.5, "value": [ "true" ] } ] }, "precision": 3 }'
Example response:
{ "search_fields": { "description": { "weight": 9.2 }, "nps_link": { "weight": 1 }, "states": { "weight": 3 }, "title": { "weight": 1 }, "world_heritage_site": { "weight": 1 }, "id": { "weight": 1 } }, "boosts": { "world_heritage_site": [ { "type": "value", "factor": 9.5, "value": [ "true" ] } ] }, "precision": 3 }
Reset search settings
editReset the search settings for a given engine back to the App Search default values.
Your search settings will be lost. You may want to back up your settings before resetting them.
POST /api/as/v1/engines/{ENGINE_NAME}/search_settings/reset
Example - A POST
request to national-parks-demo
.
curl -X POST 'https://[instance id].ent-search.[region].[provider].cloud.es.io:443/api/as/v1/engines/national-parks-demo/search_settings/reset' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer private-xxxxxxxxxxxxxxxx'
Example response:
{ "search_fields": { "description": { "weight": 1 }, "nps_link": { "weight": 1 }, "states": { "weight": 1 }, "title": { "weight": 1 }, "world_heritage_site": { "weight": 1 }, "id": { "weight": 1 } }, "boosts": {}, "precision": 2 }