forked from elastic/elasticsearch
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Indices query/filter skip parsing altogether for irrelevant indices w…
…hen possible Closes elastic#2416
- Loading branch information
Showing
7 changed files
with
364 additions
and
34 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
[[query-dsl-indices-filter]] | ||
=== Indices Filter | ||
|
||
The `indices` filter can be used when executed across multiple indices, | ||
allowing to have a filter that executes only when executed on an index | ||
that matches a specific list of indices, and another filter that executes | ||
when it is executed on an index that does not match the listed indices. | ||
|
||
[source,js] | ||
-------------------------------------------------- | ||
{ | ||
"indices" : { | ||
"indices" : ["index1", "index2"], | ||
"filter" : { | ||
"term" : { "tag" : "wow" } | ||
}, | ||
"no_match_filter" : { | ||
"term" : { "tag" : "kow" } | ||
} | ||
} | ||
} | ||
-------------------------------------------------- | ||
|
||
You can use the `index` field to provide a single index. | ||
|
||
`no_match_filter` can also have "string" value of `none` (to match no | ||
documents), and `all` (to match all). Defaults to `all`. | ||
|
||
`filter` is mandatory. You must provide the indices. | ||
It is forbidden to omit or to give `indices` or `index` multiple times, | ||
or to give both. | ||
|
||
Please note that the fields order is important: If the indices are | ||
provided before `filter` or `no_match_filter`, the filter parsing is | ||
skipped altogether. | ||
For instance, this feature is useful to prevent a query that runs | ||
against multiple indices to fail because of a missing type. | ||
See `has_child`, `has_parent`, `top_children` and `nested`. |
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
Oops, something went wrong.