|
@@ -26,20 +26,25 @@ Or, with a request body:
|
|
|
[source,js]
|
|
|
--------------------------------------------------
|
|
|
curl -XGET 'http://localhost:9200/twitter/tweet/_validate/query' -d '{
|
|
|
- "filtered" : {
|
|
|
- "query" : {
|
|
|
- "query_string" : {
|
|
|
- "query" : "*:*"
|
|
|
+ "query" : {
|
|
|
+ "filtered" : {
|
|
|
+ "query" : {
|
|
|
+ "query_string" : {
|
|
|
+ "query" : "*:*"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "filter" : {
|
|
|
+ "term" : { "user" : "kimchy" }
|
|
|
}
|
|
|
- },
|
|
|
- "post_filter" : {
|
|
|
- "term" : { "user" : "kimchy" }
|
|
|
}
|
|
|
}
|
|
|
}'
|
|
|
{"valid":true,"_shards":{"total":1,"successful":1,"failed":0}}
|
|
|
--------------------------------------------------
|
|
|
|
|
|
+NOTE: The query being sent in the body must be nested in a `query` key, same as
|
|
|
+the <<search-search,search api>> works added[1.0.0.RC1,The query was previously the top-level object].
|
|
|
+
|
|
|
If the query is invalid, `valid` will be `false`. Here the query is
|
|
|
invalid because Elasticsearch knows the post_date field should be a date
|
|
|
due to dynamic mapping, and 'foo' does not correctly parse into a date:
|