Adds CONSOLE to count api

This commit is contained in:
Isabel Drost-Fromm 2016-05-18 13:36:19 +02:00
parent f22f3c7df5
commit 125b715e45
1 changed files with 10 additions and 3 deletions

View File

@ -10,15 +10,21 @@ body. Here is an example:
[source,js] [source,js]
-------------------------------------------------- --------------------------------------------------
$ curl -XGET 'http://localhost:9200/twitter/tweet/_count?q=user:kimchy' PUT /twitter/tweet/1?refresh
{
"user": "kimchy"
}
$ curl -XGET 'http://localhost:9200/twitter/tweet/_count' -d ' GET /twitter/tweet/_count?q=user:kimchy
GET /twitter/tweet/_count
{ {
"query" : { "query" : {
"term" : { "user" : "kimchy" } "term" : { "user" : "kimchy" }
} }
}' }
-------------------------------------------------- --------------------------------------------------
//CONSOLE
NOTE: The query being sent in the body must be nested in a `query` key, same as NOTE: The query being sent in the body must be nested in a `query` key, same as
the <<search-search,search api>> works the <<search-search,search api>> works
@ -37,6 +43,7 @@ tweets from the twitter index for a certain user. The result is:
} }
} }
-------------------------------------------------- --------------------------------------------------
// TESTRESPONSE
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.