Skip to content

Commit

Permalink
[DOCS] fixed count and validate query docs, they now require a top-le…
Browse files Browse the repository at this point in the history
…vel query object, same as other apis

Relates to #4074
Closes #5111
  • Loading branch information
javanna committed Feb 13, 2014
1 parent 0b2a983 commit 130102c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
3 changes: 3 additions & 0 deletions docs/reference/docs/delete-by-query.asciidoc
Expand Up @@ -19,6 +19,9 @@ $ curl -XDELETE 'http://localhost:9200/twitter/tweet/_query' -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 above examples end up doing the same thing, which is delete all
tweets from the twitter index for a certain user. The result of the
commands is:
Expand Down
7 changes: 3 additions & 4 deletions docs/reference/search/count.asciidoc
Expand Up @@ -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:

Expand All @@ -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

Expand Down
19 changes: 12 additions & 7 deletions docs/reference/search/validate.asciidoc
Expand Up @@ -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:
Expand Down

0 comments on commit 130102c

Please sign in to comment.