Browse Source

Adds CONSOLE to count api

Isabel Drost-Fromm 9 years ago
parent
commit
125b715e45
1 changed files with 10 additions and 3 deletions
  1. 10 3
      docs/reference/search/count.asciidoc

+ 10 - 3
docs/reference/search/count.asciidoc

@@ -10,15 +10,21 @@ body. Here is an example:
 
 [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" : {
         "term" : { "user" : "kimchy" }
     }
-}'
+}
 --------------------------------------------------
+//CONSOLE
 
 NOTE: The query being sent in the body must be nested in a `query` key, same as
 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
 count all the docs.