I guess you are still on 0.90, where the count request is slightly
different compared to a search request, as it contains the query without it
being wrapped into the query object:
{
"term" : {"field":"value"}
}
instead of
{
"query" : {
"term" : {"field":"value"}
}
}
Beware that we changed this in 1.0 to have consistency between count api
and search api.
On Monday, February 24, 2014 4:51:43 AM UTC+1, pulkitsinghal wrote:
>
> Hello,
>
> I have a bool query with a filter applied to it, which runs against the
> _search endpoint successfully giving "hits.total" but unfortunately it also
> gives a lot more data than that which I don't need.
>
> So I thought of running the same query against the _count endpoint but
> there I received a
> failure: "BroadcastShardOperationFailedException[[index_test][0] ]; nested:
> QueryParsingException[[index_test] No query registered for [query]]; "
>
> Is there some other lightweight manner in which I can get just
> "hits.total" without the added bloat of each matching doc?
>
> Thanks!
> - Pulkit
>
--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/6d7827db-af6e-4f5e-a394-bfb09652be7a%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.