aparo / pyes

Python connector for ElasticSearch - the pythonic way to use ElasticSearch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

count bug

fallmoon opened this issue · comments

python: 2.7
pyes: 0.99.2 stable
ES: 1.1.2

In [1]: import pyes

In [2]: conn = pyes.ES('http://localhost:9200')

In [3]: conn.count(query=None, indices="lfsj", doc_types=None)
---------------------------------------------------------------------------
ElasticSearchException                    Traceback (most recent call last)
/root/<ipython-input-3-dd3c3bf7ca81> in <module>()
----> 1 conn.count(query=None, indices="lfsj", doc_types=None)

/usr/local/lib/python2.7/dist-packages/pyes/es.pyc in count(self, query, indices, doc_types, **query_params)
   1128         body = self._encode_query(query)
   1129         path = self._make_path(indices, doc_types, "_count")
-> 1130         return self._send_request('GET', path, body, params=query_params)
   1131
   1132     #--- river management


/usr/local/lib/python2.7/dist-packages/pyes/es.pyc in _send_request(self, method, path, body, params, headers, raw, return_response)
    468                 raise ElasticSearchException(response_body, response.status, response_body)
    469         if response.status not in [200, 201]:
--> 470             raise_if_error(response.status, decoded)
    471         if not raw and isinstance(decoded, dict):
    472             decoded = DotDict(decoded)

/usr/local/lib/python2.7/dist-packages/pyes/convert_errors.pyc in raise_if_error(status, result, request)
     65     if not isinstance(result, dict) or 'error' not in result:
     66         raise exceptions.ElasticSearchException("Unknown exception type: %d, %s" % (status, result), status,
---> 67             result, request)
     68
     69     error = result['error']

ElasticSearchException: Unknown exception type: 400, {u'count': 0, u'_shards': {u'successful': 0, u'failed': 1, u'total': 1, u'failures': [{u'index': u'lfsj', u'reason': u'BroadcastShardOperationFailedException[[lfsj][0] ]; nested: QueryParsingException[[lfsj] request does not support [match_all]]; ', u'shard': 0}]}}