-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge with master and resolve conflicts
- Loading branch information
Showing
466 changed files
with
11,956 additions
and
4,436 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
[[upgrade-assistant-api-default-field]] | ||
=== Add default field API | ||
++++ | ||
<titleabbrev>Add default field</titleabbrev> | ||
++++ | ||
|
||
experimental[] In {es} 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 {es}, 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 {es} 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 {es} index. | ||
|
||
[[upgrade-assistant-api-default-field-request]] | ||
==== Request | ||
|
||
To add the `index.query.default_field` setting to an {es} index, submit a POST request to `/api/upgrade_assistant/add_query_default_field/<index>`: | ||
|
||
[source,js] | ||
-------------------------------------------------- | ||
GET /api/upgrade_assistant/add_query_default_field/myIndex | ||
{ | ||
"fieldTypes": ["text", "keyword"], <1> | ||
"otherFields": ["myField.*"] <2> | ||
} | ||
-------------------------------------------------- | ||
// KIBANA | ||
|
||
<1> A required array of {es} field types that generate the list of fields. | ||
<2> An optional array of additional field names, dot-deliminated. | ||
|
||
To add the `index.query.default_field` index setting to the specified index, {kib} generates an array of all fields from the index mapping. | ||
The fields contain the types specified in `fieldTypes`. {kib} appends any other fields specified in `otherFields` to the array of default fields. | ||
|
||
[[upgrade-assistant-api-default-field-response-codes]] | ||
==== Response codes | ||
|
||
`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. | ||
|
||
[[upgrade-assistant-api-default-field-response-body]] | ||
==== Response body | ||
|
||
The response body contains a JSON structure, similar to the following: | ||
|
||
[source,js] | ||
-------------------------------------------------- | ||
{ | ||
"acknowledged": true | ||
} | ||
-------------------------------------------------- | ||
|
||
[[upgrade-assistant-api-default-field-example]] | ||
==== Example | ||
|
||
Your index contains following mappings: | ||
|
||
[source,js] | ||
-------------------------------------------------- | ||
GET /myIndex/_mappings | ||
{ | ||
"myIndex": { | ||
"mappings": { | ||
"properties": { | ||
"field1": { "type": "text" }, | ||
"field2": { "type": "float" }, | ||
"nestedfield": { | ||
"properties": { | ||
"field3": { "type": "keyword" }, | ||
"field4": { "type": "long" }, | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
-------------------------------------------------- | ||
// CONSOLE | ||
|
||
Make the following request to {kib}: | ||
|
||
[source,js] | ||
-------------------------------------------------- | ||
GET /api/upgrade_assistant/add_query_default_field/myIndex | ||
{ | ||
"fieldTypes": ["text", "long"], | ||
"otherFields": ["field2"] | ||
} | ||
-------------------------------------------------- | ||
// KIBANA | ||
|
||
The API returns the following: | ||
|
||
[source,js] | ||
-------------------------------------------------- | ||
GET /myIndex/_settings?flat_settings=true | ||
{ | ||
"myIndex": { | ||
"settings": { | ||
"index.query.default_field": [ | ||
"field1", | ||
"nestedfield.field4", | ||
"field2", | ||
] | ||
} | ||
} | ||
} | ||
-------------------------------------------------- | ||
// CONSOLE | ||
|
||
{kib} generates the `field1` and `nestedfield.field4` values based on the specified `fieldTypes`, then appends the `otherFields` to the array. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.