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

Add rewrite query parameter to the indices.validate_query API spec #11580

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions rest-api-spec/api/indices.validate_query.json
Expand Up @@ -66,6 +66,10 @@
"lowercase_expanded_terms": {
"type" : "boolean",
"description" : "Specify whether query terms should be lowercased"
},
"rewrite": {
"type": "boolean",
"description": "Provide a more detailed explanation showing the actual Lucene query that will be executed."
}
}
},
Expand Down
9 changes: 9 additions & 0 deletions rest-api-spec/test/indices.validate_query/10_basic.yaml
Expand Up @@ -33,4 +33,13 @@
- match: {_shards.failed: 0}
- match: {explanations.0.index: 'testing'}
- match: {explanations.0.explanation: '*:*'}

- do:
indices.validate_query:
rewrite: true

- is_true: valid
- match: {_shards.failed: 0}
- match: {explanations.0.index: 'testing'}
- match: {explanations.0.explanation: 'ConstantScore(*:*)'}