0

バージョン 2.1.1 の Elasticsearch インスタンスを照会するために、elasticsearch-py バージョン 2.1.0 を使用して次の集計クエリを試しています。

{
  "query": {
    "filtered": {
      "filter": { "term": {"applicationType":"myapptype"} }      
    }
  },
  "aggs":{ "client_id": { "terms": { "field": "client_id" } } }
}

それは言って例外を与えます:

Traceback (most recent call last):
  File "searchES2.py", line 52, in <module>
    for item in res:
  File "/usr/local/lib/python2.7/dist-packages/elasticsearch/helpers/__init__.py", line 271, in scan
    resp = client.search(body=query, scroll=scroll, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/elasticsearch/client/utils.py", line 69, in _wrapped
    return func(*args, params=params, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/elasticsearch/client/__init__.py", line 530, in search
    doc_type, '_search'), params=params, body=body)
  File "/usr/local/lib/python2.7/dist-packages/elasticsearch/transport.py", line 307, in perform_request
    status, headers, data = connection.perform_request(method, url, params, body, ignore=ignore, timeout=timeout)
  File "/usr/local/lib/python2.7/dist-packages/elasticsearch/connection/http_urllib3.py", line 93, in perform_request
    self._raise_error(response.status, raw_data)
  File "/usr/local/lib/python2.7/dist-packages/elasticsearch/connection/base.py", line 105, in _raise_error
    raise HTTP_EXCEPTIONS.get(status_code, TransportError)(status_code, error_message, additional_info)
elasticsearch.exceptions.RequestError: TransportError(400, u'search_phase_execution_exception')

これを修正する方法は?

注: cURL を使用すると、同じクエリが正常に機能します。

4

0 に答える 0