- Kibana Guide: other versions:
- What is Kibana?
- What’s new in 8.3
- Kibana concepts
- Quick start
- Set up
- Install Kibana
- Configure Kibana
- Alerting and action settings
- APM settings
- Banners settings
- Enterprise Search settings
- Fleet settings
- i18n settings
- Logging settings
- Logs settings
- Metrics settings
- Monitoring settings
- Reporting settings
- Search sessions settings
- Secure settings
- Security settings
- Spaces settings
- Task Manager settings
- Telemetry settings
- URL drilldown settings
- Start and stop Kibana
- Access Kibana
- Securing access to Kibana
- Add data
- Upgrade Kibana
- Configure security
- Configure reporting
- Configure logging
- Configure monitoring
- Command line tools
- Production considerations
- Discover
- Dashboard and visualizations
- Canvas
- Maps
- Build a map to compare metrics by country or region
- Track, visualize, and alert on assets in real time
- Map custom regions with reverse geocoding
- Heat map layer
- Tile layer
- Vector layer
- Plot big data
- Search geographic data
- Configure map settings
- Connect to Elastic Maps Service
- Import geospatial data
- Troubleshoot
- Reporting and sharing
- Machine learning
- Graph
- Alerting
- Observability
- APM
- Security
- Dev Tools
- Fleet
- Osquery
- Stack Monitoring
- Stack Management
- REST API
- Get features API
- Kibana spaces APIs
- Kibana role management APIs
- User session management APIs
- Saved objects APIs
- Data views API
- Index patterns APIs
- Alerting APIs
- Action and connector APIs
- Cases APIs
- Import and export dashboard APIs
- Logstash configuration management APIs
- Machine learning APIs
- Short URLs APIs
- Get Task Manager health
- Upgrade assistant APIs
- Kibana plugins
- Troubleshooting
- Accessibility
- Release notes
- Developer guide
Add default field API
editAdd default field API
edit
[preview]
This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.
In Elasticsearch 7.0 and later, some query types, such as Simple Query String, have a limit to the number of fields they can query against.
To configure the cap in Elasticsearch, set the indices.query.bool.max_clause_count
cluster setting, which is 1024 by default.
For indices with more fields than the cap, add the index.query.default_field
index setting to inform Elasticsearch which
fields to use by default when no field is specified for a query. Use the add default field API to add the index.query.default_field
setting to an Elasticsearch index.
Request
editTo add the index.query.default_field
setting to an Elasticsearch index, submit a POST request to /api/upgrade_assistant/add_query_default_field/<index>
:
GET /api/upgrade_assistant/add_query_default_field/myIndex { "fieldTypes": ["text", "keyword"], "otherFields": ["myField.*"] }
A required array of Elasticsearch field types that generate the list of fields. |
|
An optional array of additional field names, dot-delimited. |
To add the index.query.default_field
index setting to the specified index, Kibana generates an array of all fields from the index mapping.
The fields contain the types specified in fieldTypes
. Kibana appends any other fields specified in otherFields
to the array of default fields.
Response codes
edit-
200
- Indicates a successful call.
-
400
-
Indicates that the index already has the
index.query.default_field
setting. No changes are made to the index.
Response body
editThe response body contains a JSON structure, similar to the following:
{ "acknowledged": true }
Example
editYour index contains following mappings:
GET /myIndex/_mappings { "myIndex": { "mappings": { "properties": { "field1": { "type": "text" }, "field2": { "type": "float" }, "nestedfield": { "properties": { "field3": { "type": "keyword" }, "field4": { "type": "long" }, } } } } } }
Make the following request to Kibana:
GET /api/upgrade_assistant/add_query_default_field/myIndex { "fieldTypes": ["text", "long"], "otherFields": ["field2"] }
The API returns the following:
GET /myIndex/_settings?flat_settings=true { "myIndex": { "settings": { "index.query.default_field": [ "field1", "nestedfield.field4", "field2", ] } } }
Kibana generates the field1
and nestedfield.field4
values based on the specified fieldTypes
, then appends the otherFields
to the array.
On this page