gpt4 book ai didi

django - 无法使用:TransportErrorr(400, 'parsing_exception')查询Elasticsearch

转载 作者:行者123 更新时间:2023-12-02 22:27:35 33 4
gpt4 key购买 nike

我一直在尝试让Elasticsearch在Django应用程序中工作。这是一个问题,因为显然涉及兼容性问题。我遵循了建议,但是在实际执行搜索时仍然出现错误。

这是我所拥有的

Django==2.1.7
Django-Haystack==2.5.1
Elasticsearch(django)==1.7.0
Elasticsearch(Linux app)==5.0.1

还有 DjangoCMS==3.7aldryn-search=1.0.1,但我不确定它们之间的相关性。

这是我通过基本文本表单提交搜索查询时遇到的错误。
GET /videos/modelresult/_search?_source=true [status:400 request:0.001s]
Failed to query Elasticsearch using '(video)': TransportError(400, 'parsing_exception')
Traceback (most recent call last):
File "/home/user-name/miniconda3/envs/project-web/lib/python3.7/site-packages/haystack/backends/elasticsearch_backend.py", line 524, in search
_source=True)
File "/home/user-name/miniconda3/envs/project-web/lib/python3.7/site-packages/elasticsearch/client/utils.py", line 69, in _wrapped
return func(*args, params=params, **kwargs)
File "/home/user-name/miniconda3/envs/project-web/lib/python3.7/site-packages/elasticsearch/client/__init__.py", line 527, in search
doc_type, '_search'), params=params, body=body)
File "/home/user-name/miniconda3/envs/project-web/lib/python3.7/site-packages/elasticsearch/transport.py", line 307, in perform_request
status, headers, data = connection.perform_request(method, url, params, body, ignore=ignore, timeout=timeout)
File "/home/user-name/miniconda3/envs/project-web/lib/python3.7/site-packages/elasticsearch/connection/http_urllib3.py", line 93, in perform_request
self._raise_error(response.status, raw_data)
File "/home/user-name/miniconda3/envs/project-web/lib/python3.7/site-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, 'parsing_exception')

有人可以告诉我这是兼容性问题还是其他问题?我该如何解决?

最佳答案

看来对我的设置有用的组合如下。我相信关键是要大大降低Elasticsearch的等级。

Elasticsearch=1.7.6 (with Java 8)
Django==2.1.7
Django-Haystack==2.8.1
elasticsearch==1.7.0

以下两个项目可能相关也可能不相关。我没有改变他们。
DjangoCMS==3.7.0
aldryn-search==1.0.1

关于django - 无法使用:TransportErrorr(400, 'parsing_exception')查询Elasticsearch,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59024118/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com