[DOCS] fixed count and validate query docs, they now require a top-level query object, same as other apis
Relates to #4074 Closes #5111
This commit is contained in:
parent
5d01aac87e
commit
01abea5945
|
@ -19,7 +19,10 @@ $ curl -XDELETE 'http://localhost:9200/twitter/tweet/_query' -d '{
|
|||
'
|
||||
--------------------------------------------------
|
||||
|
||||
Both above examples end up doing the same thing, which is delete all
|
||||
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].
|
||||
|
||||
Both above examples end up do the same thing, which is delete all
|
||||
tweets from the twitter index for a certain user. The result of the
|
||||
commands is:
|
||||
|
||||
|
|
|
@ -18,6 +18,9 @@ $ curl -XGET 'http://localhost:9200/twitter/tweet/_count' -d '
|
|||
}'
|
||||
--------------------------------------------------
|
||||
|
||||
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].
|
||||
|
||||
Both examples above do the same thing, which is count the number of
|
||||
tweets from the twitter index for a certain user. The result is:
|
||||
|
||||
|
@ -36,10 +39,6 @@ tweets from the twitter index for a certain user. The result is:
|
|||
The query is optional, and when not provided, it will use `match_all` to
|
||||
count all the docs.
|
||||
|
||||
|
||||
NOTE: in contrast to <<search-search>> the query being sent in the body must
|
||||
*not* be nested in a `query` key.
|
||||
|
||||
[float]
|
||||
=== Multi index, Multi type
|
||||
|
||||
|
|
|
@ -26,20 +26,25 @@ Or, with a request body:
|
|||
[source,js]
|
||||
--------------------------------------------------
|
||||
curl -XGET 'http://localhost:9200/twitter/tweet/_validate/query' -d '{
|
||||
"query" : {
|
||||
"filtered" : {
|
||||
"query" : {
|
||||
"query_string" : {
|
||||
"query" : "*:*"
|
||||
}
|
||||
},
|
||||
"post_filter" : {
|
||||
"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:
|
||||
|
|
Loading…
Reference in New Issue