Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow index filtering in field capabilities API (#57276) #58299

Merged
merged 4 commits into from
Jun 18, 2020

Conversation

jimczi
Copy link
Contributor

@jimczi jimczi commented Jun 17, 2020

Backport of #57276

* Add index filtering in field capabilities API

This change allows to use an `index_filter` in the
field capabilities API. Indices are filtered from
the response if the provided query rewrites to `match_none`
on every shard:

````
GET metrics-*
{
  "index_filter": {
    "bool": {
      "must": [
        "range": {
          "@timestamp": {
            "gt": "2019"
          }
        }
      }
  }
}
````

The filtering is done on a best-effort basis, it uses the can match phase
to rewrite queries to `match_none` instead of fully executing the request.
The first shard that can match the filter is used to create the field
capabilities response for the entire index.

Closes elastic#56195
jimczi added a commit to jimczi/elasticsearch that referenced this pull request Jun 17, 2020
This commit adapts the bwc version in preparation of the backport
to 7.x. The bwc tests are disabled in order to allow the merge of
elastic#58299.

Relates elastic#58299
jimczi added 2 commits June 18, 2020 00:26
Fix multi_cluster/100_resolve_index/Resolve index with indices, aliases, and data streams
jimczi added a commit that referenced this pull request Jun 18, 2020
This commit adapts the bwc version in preparation of the backport
to 7.x. The bwc tests are disabled in order to allow the merge of
#58299.

Relates #58299
@jimczi jimczi merged commit 82db0b5 into elastic:7.x Jun 18, 2020
@jimczi jimczi deleted the backport/field_caps_index_filter branch June 18, 2020 08:23
jimczi added a commit to jimczi/elasticsearch that referenced this pull request Jun 18, 2020
jimczi added a commit that referenced this pull request Jun 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant