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?
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?
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?
Hey @David, since Luca had zeroed-in-on the issue, I'll skip providing the
query this time.
@Luca - Thanks! That was exactly the problem! Another thing that is
inconsistent right now is that I can use date math against the _search
endpoint for filters but not against the _count endpoint in 0.90:
"lt" : "now",
"gte" : "now-1w"
versus:
"lt" : "2014-02-24",
"gte" : "2014-02-17"
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?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.