- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 Python Elasticsearch 在 elasticsearch (v. 1.7) 集群上运行基本过滤器。令人惊讶的是,我可以重复运行完全相同的代码,并以大约 1/2 的时间成功查询,并以大约 1/2 的时间收到 TransportError 400。我想知道这是我的语法原因还是我无法控制的原因。
from elasticsearch import Elasticsearch
host_list = [HOST3, HOST4]
client = Elasticsearch(hosts = host_list, timeout = 120)
q = {"from" : 0,
"size" : 0,
"query": {
"filtered": {
"filter": {
"bool": {
"should": [
{"term": {
"field1": ["value1"]
}},
{"term": {
"field2": ["value2"]
}}
],
"must": [
{"range": {
"times": {
"gte": "2015-04-21T00:00:00Z",
"lte": "2015-04-22T00:00:00Z"
}
}}
]
}
}
}
}}
res = client.search(index = "index_name", doc_type = ("doc_type_name"), body = q)
返回
RequestError Traceback (most recent call last)
--> 265 res = client.search(...)
(omitting long traceback through ES module code)
RequestError: TransportError(400, u'search_phase_execution_exception')
但另一半时间我得到的是有效结果?!有什么想法吗?
最佳答案
它可能是您的一位宿主已经死了。您应该尝试将 host_list
限制为 HOST3
并重试,然后将 host_list
限制为仅 HOST4
并重试。您会立即看到您的其中一台主机是否已关闭。
关于Python Elasticsearch,RequestError : TransportError(400, u'search_phase_execution_exception') 间歇性发生。为什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34227883/
我正在使用elasticsearch-py在 flex 索引中添加一些字典, 我将字典添加到索引和包含列表的字典,在我的代码中添加了该字典,但它给了我这样的错误: RequestError: Tran
我正在尝试使用 Python 和 Elasticsearch 从索引中读取文档。我收到一个错误,我找不到解决办法。有谁知道我该如何解决这个问题? 我在网上查找了同样的问题,但找不到任何相关的文章/解决
我有一些Python代码,试图将某些文件解析为AWS ES。下面是代码: import re import elasticsearch import itertools from elasticsea
用小的术语列表搜索给出我想要的东西 In [29]: small_list Out[29]: [8096, 8105, 8114, 8116, 8128, 8130] In [30]: sqs.fil
我正在尝试将django-haystack与djangorestframework和elasticsearch一起使用,并遵循了here教程 我在虚拟环境中安装了以下软件包 djangorestfra
我正在通过 Google map 网络服务的 Python 客户端库使用 Google map API 在 Google App Engine 中设置一个项目 我尝试了以下示例代码: import g
我刚开始学习 Elasticsearch,我遇到了一个问题,但我找不到解决这个问题的方法。这是我的问题 File "/home/dat/.local/lib/python2.7/site-packag
我正在使用 Python API 创建 Elasticsearch 索引,如下所示: from elasticsearch import Elasticsearch es = Elasticsearc
创建索引: def create_index(index_name): es=create_elastic_search_object() entry_mapping = {
我正在使用 Python Elasticsearch 在 elasticsearch (v. 1.7) 集群上运行基本过滤器。令人惊讶的是,我可以重复运行完全相同的代码,并以大约 1/2 的时间成功查
导致此错误的主要原因是所选字符串以/开头,或者其中包含许多/符号。 示例:“/ abc / cd / ef” 如果选定的字符串中不包含/,则效果很好。 这是查询正在使用: f1= += ',
我正在尝试使用django-elasticsearch-dsl和Elasticsearch服务器将Django应用程序转换为使用ElsaticBeanStalk部署的AWS ElasticSearch
我在我的 Django 项目中使用 elasticsearch 作为 haystack 的后端。如前所述,我创建了搜索所需的所有内容 here .但是当我搜索时,我抛出了一个回溯错误 Transpor
我正在尝试创建一个管道以在 python 客户端中使用摄取附件处理器插件,如下所示: from elasticsearch import Elasticsearch es = Elasticsea
当我尝试在 elasticsearch 中存储任何内容时,出现错误提示: TransportError(403, u'cluster_block_exception', u'blocked by: [
我是一名优秀的程序员,十分优秀!