aparo / pyes

Python connector for ElasticSearch - the pythonic way to use ElasticSearch
BSD 3-Clause "New" or "Revised" License
607 stars 270 forks source link

count api fails #472

Closed ajaydivakaran closed 9 years ago

ajaydivakaran commented 9 years ago

I'm using ES 0.90.13

The API:

conn.count(indices=['my-index'], doc_types=['doc-type'], query=TermQuery(field='void', value=False))

This is what I find in the logs:

curl -XGET 'http://127.0.0.1:9200/my-index/doc-type/_count?pretty=true' -d '{"query": {"term": {"void": false}}}'# response status: 200# response body: {"count":0,"_shards":{"total":1,"successful":0,"failed":1,"failures":[{"index":"my-index","shard":0,"reason":"BroadcastShardOperationFailedException[[my-index][0] ]; nested: QueryParsingException[[my-index] No query registered for [query]]; "}]}}

Issue: The outer query should not exist

aparo commented 9 years ago

You should upgrade to master. If you want I'll do a release of the last version on Pypi.

ajaydivakaran commented 9 years ago

Thanks for the reply. The latest version available on pip is 0.99.5.

It would be great if you could push this fix to Pypi. Thanks

ajaydivakaran commented 9 years ago

Even on the master branch I see the outer query exists for the count function. Is the fix different?

aparo commented 9 years ago

Which version of ElasticSearch are you using? It must be 1.x or above.

ajaydivakaran commented 9 years ago

I'm using 0.90.13

aparo commented 9 years ago

You should upgrade to 1.3 a least. The 1.4 is better for data security.

ajaydivakaran commented 9 years ago

Thanks for the info.