Add a default field Technical Preview

GET /api/upgrade_assistant/add_query_default_field/{index}

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. 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.

application/json

Body Required

  • fieldTypes array Required

    An array of Elasticsearch field types that generate the list of fields.

  • An optional array of additional field names, dot-delimited.

Responses

  • 200 application/json

    Indicates a successful call.

    Hide response attribute Show response attribute object
  • Indicates that the index already has the index.query.default_field setting. No changes are made to the index.

GET /api/upgrade_assistant/add_query_default_field/{index}
curl \
 --request GET 'https://localhost:5601/api/upgrade_assistant/add_query_default_field/{index}' \
 --header "Authorization: $API_KEY" \
 --header "Content-Type: application/json" \
 --data '"{\n  \"fieldTypes\": [\"text\", \"keyword\"], \n  \"otherFields\": [\"myField.*\"] \n}"'
Request example
Run `GET /api/upgrade_assistant/add_query_default_field/myIndex` to add the `index.query.default_field` setting to an Elasticsearch index.
{
  "fieldTypes": ["text", "keyword"], 
  "otherFields": ["myField.*"] 
}
Response examples (200)
{
  "acknowledged": true
}