问题
Failed to query Elasticsearch using '*:*': TransportError(400,u'parsing_exception', u'no [query] registered for [filtered]')
Traceback (most recent call last): File "C:\Python27\lib\site-packages\haystack\backends\elasticsearch_backend.py", line 524, in search
_source=True)
File "C:\Python27\lib\site-packages\elasticsearch\client\utils.py", line 71, in _wrapped
return func(*args, params=params, **kwargs)
File "C:\Python27\lib\site-packages\elasticsearch\client\__init__.py", line 569, in search
doc_type, '_search'), params=params, body=body)
File "C:\Python27\lib\site-packages\elasticsearch\transport.py", line 327, in perform_request
status, headers, data = connection.perform_request(method, url, params, body, ignore=ignore, timeout=timeout)
File "C:\Python27\lib\site-packages\elasticsearch\connection\http_urllib3.py", line 124, in perform_request
self._raise_error(response.status, raw_data)
File "C:\Python27\lib\site-packages\elasticsearch\connection\base.py", line 122, in _raise_error
raise HTTP_EXCEPTIONS.get(status_code, TransportError)(status_code, error_message, additional_info)
RequestError: TransportError(400, u'parsing_exception', u'no [query] registered for [filtered]')
Have been getting "No results found" on the default search form from haystack documentation. When I try to call count on searchqueryset , I get this error.
回答1:
Elasticsearch version 5 is not supported yet (http://django-haystack.readthedocs.io/en/v2.5.1/installing_search_engines.html#elasticsearch):
Haystack currently only supports ElasticSearch 1.x. ElasticSearch 2.x is not supported yet, if you would like to help, please see #1247.
So we are left with only version 1.x
来源:https://stackoverflow.com/questions/40596044/no-results-found-on-django-haystack-elasticsearch