[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:
Luca Cavanna 2014-02-13 11:30:13 +01:00
parent 5d01aac87e
commit 01abea5945
3 changed files with 19 additions and 12 deletions

View File

@ -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 tweets from the twitter index for a certain user. The result of the
commands is: commands is:

View File

@ -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 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: 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 The query is optional, and when not provided, it will use `match_all` to
count all the docs. 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] [float]
=== Multi index, Multi type === Multi index, Multi type

View File

@ -26,20 +26,25 @@ Or, with a request body:
[source,js] [source,js]
-------------------------------------------------- --------------------------------------------------
curl -XGET 'http://localhost:9200/twitter/tweet/_validate/query' -d '{ curl -XGET 'http://localhost:9200/twitter/tweet/_validate/query' -d '{
"query" : {
"filtered" : { "filtered" : {
"query" : { "query" : {
"query_string" : { "query_string" : {
"query" : "*:*" "query" : "*:*"
} }
}, },
"post_filter" : { "filter" : {
"term" : { "user" : "kimchy" } "term" : { "user" : "kimchy" }
} }
} }
}
}' }'
{"valid":true,"_shards":{"total":1,"successful":1,"failed":0}} {"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 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 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: due to dynamic mapping, and 'foo' does not correctly parse into a date: