- 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
- Crawl custom fields using proxy
- Curations
- Elasticsearch search
- Elasticsearch index engines
- Create Elasticsearch index engines
- Configure dynamic field mappings and analyzers in an Elasticsearch index engine
- Elasticsearch engines text field conventions
- 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
- App Search 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
- Elasticsearch search 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
- Search Explain API
- Source engines API
- Synonyms API
- Web crawler API reference
- API Clients
- Configuration
- Known issues
- 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 <ENTERPRISE_SEARCH_BASE_URL>/api/as/v1/engines/{ENGINE_NAME}/search_settings
Example - A GET
request to national-parks-demo
:
curl -X GET '<ENTERPRISE_SEARCH_BASE_URL>/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, "precision_enabled": true }
Update search settings
editUpdate the search settings for a given engine.
The precision_enabled
field is read-only.
It tells you whether it is possible to change the precision
setting.
If you try to change the precision_enabled
field, or the precision
setting when precision_enabled
is false
for an engine, you will receive an error.
To understand how to enable precision tuning with an Elasticsearch based engine, check Elasticsearch engines text field conventions.
Removing fields from result_fields
means that those fields are not returned in results.
PUT <ENTERPRISE_SEARCH_BASE_URL>/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 '<ENTERPRISE_SEARCH_BASE_URL>/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, "precision_enabled": true }
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 <ENTERPRISE_SEARCH_BASE_URL>/api/as/v1/engines/{ENGINE_NAME}/search_settings/reset
Example - A POST
request to national-parks-demo
.
curl -X POST '<ENTERPRISE_SEARCH_BASE_URL>/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, "precision_enabled": true }
ElasticON events are back!
Learn about the Elastic Search AI Platform from the experts at our live events.
Register now