本文介绍了“找不到结果”在Django Haystack ElasticSearch上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 使用'*:*'无法查询Elasticsearch:TransportError(400,u'parsing_exception',u'no [query] registered for [filtered]')
追溯(最近呼叫最后):文件C:\Python27\lib\site- packages\haystack\backends\elasticsearch_backend.py,第524行,搜索
_source = True)
文件C:\Python27\lib\site-packages\elasticsearch\client\utils.py,第71行,在_wrapped
中返回func(* args,params = params,* * kwargs)
文件C:\Python27\lib\site- packages\elasticsearch\client\__init __。py,行569,在搜索
doc_type,'_search') ,params = params,body = body)
文件C:\Python27\lib\site- packages\elasticsearch\transport.py,第327行,在perform_request
状态,标题,data = connection.perform_request(method,url,params,body,ignore = ignore,timeout = timeout)
文件C:\Python27\lib\site-packages\elast icsearch\connection\http_urllib3.py,第124行,在perform_request
self._raise_error(response.status,raw_data)
文件C:\Python27\lib\site- packages\\ \\ lasticsearch\connection\base.py,第122行,在_raise_error
中提高HTTP_EXCEPTIONS.get(status_code,TransportError)(status_code,error_message,additional_info)
RequestError:TransportError(400,u'parsing_exception ',u'no [查询]注册[筛选]'

已经得到没有结果在haystack文档的默认搜索表单上找到。当我尝试在searchqueryset上调用count时,我得到这个错误。

解决方案

Elasticsearch版本5还不支持():

所以我们只剩下版本1.x


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.

解决方案

Elasticsearch version 5 is not supported yet (http://django-haystack.readthedocs.io/en/v2.5.1/installing_search_engines.html#elasticsearch):

So we are left with only version 1.x

这篇关于“找不到结果”在Django Haystack ElasticSearch上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 10:09