How to count all records in an index/type?


(Frank Hsueh) #1

$ curl -XGET 'http://localhost:9200/twitter/tweet/_count'
{"error":"No query to execute, not in body, and not bounded to 'q'
parameter"}
<<<<

or should I just use a dummy predicate that will always succeed ?

--
Frank Hsueh | frank.hsueh@gmail.com


(Frank Hsueh) #2

doh. match_all

On Tue, Oct 25, 2011 at 11:29 AM, Frank Hsueh frank.hsueh@gmail.com wrote:

$ curl -XGET 'http://localhost:9200/twitter/tweet/_count'
{"error":"No query to execute, not in body, and not bounded to 'q'
parameter"}
<<<<

or should I just use a dummy predicate that will always succeed ?

--
Frank Hsueh | frank.hsueh@gmail.com

--
Frank Hsueh | frank.hsueh@gmail.com


(Shay Banon) #3

The query is no longer required in the count API in master (upcoming 0.18)
:slight_smile:

On Wed, Oct 26, 2011 at 1:06 AM, Frank Hsueh frank.hsueh@gmail.com wrote:

doh. match_all

On Tue, Oct 25, 2011 at 11:29 AM, Frank Hsueh frank.hsueh@gmail.comwrote:

$ curl -XGET 'http://localhost:9200/twitter/tweet/_count'
{"error":"No query to execute, not in body, and not bounded to 'q'
parameter"}
<<<<

or should I just use a dummy predicate that will always succeed ?

--
Frank Hsueh | frank.hsueh@gmail.com

--
Frank Hsueh | frank.hsueh@gmail.com


(system) #4