- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在试验 index.max_terms_count。我尝试执行一个包含超过 65 536 个术语的术语查询,我很惊讶地看到它实际上被执行了,因为我读到了警告 here :
Executing a Terms Query request with a lot of terms can be quite slow, as each additional term demands extra processing and memory. To safeguard against this, the maximum number of terms that can be used in a Terms Query both directly or through lookup has been limited to
65536
. This default maximum can be changed for a particular index with the index settingindex.max_terms_count
.
为了进一步测试它,我尝试将 index.max_terms_count 设置为 2 或 3,但它仍然无法按我预期的方式工作。你能帮我理解我在做什么(或理解)错了吗?
步骤:
使用 Docker 运行 ES:
1.1.docker pull docker.elastic.co/elasticsearch/elasticsearch:6.6.0
1.2。 docker run -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node"docker.elastic.co/elasticsearch/elasticsearch:6.6.0
索引文档:curl -X POST http://localhost:9200/twitter/_doc/1 -H '内容类型:应用程序/json' -d '{ “用户”:“泡菜”, “发布日期”:“2009-11-15T14:12:12”, "message": "试用 Elasticsearch", “标签”:[“富”,“酒吧”,“太阳”,“云”]}'
更改设置:curl -X PUT http://localhost:9200/twitter/_settings -H '内容类型:应用程序/json' -d '{ “指数” : { “max_terms_count”:2 }}'
验证设置是否已应用:curl -X GET http://localhost:9200/twitter/_settings
执行搜索:curl -X POST ' http://localhost:9200/twitter/_search?pretty ' -H '内容类型:application/json' -d '{ “询问”: { “条款”:{“标签”:[“太阳”,“多云”,“哟”,“嗨”,“你好”]} }}'
最佳答案
在 ElasticSearch 版本 7.0 之后,index.max_terms_count
的默认值为 65536
,如果您使用默认 向 terms 命令提供超过 65536 的额外输入max_terms_count
设置。例如,65537
,它将产生以下异常消息
{
"error" : {
"root_cause" : [
{
"type" : "query_shard_exception",
"reason" : "failed to create query: The number of terms [65537] used in the Terms Query request has exceeded the allowed maximum of [65536]. This maximum can be set by changing the [index.max_terms_count] index level setting.",
"index" : "my_index",
"index_uuid" : "iJMNOR7znSsmODsG4uArTvQ"
},
....
....
...
}
Elastic search 提供了一种将 max_terms_count 增加到 2147483647 的方法。出于测试目的,我尝试设置到 2147483647,并且效果很好
PUT /my-index/_settings
{
"index" : {
"max_terms_count" : 2147483647
}
}
但是当我开始将值增加到 2147483648
PUT /my-index/_settings
{
"index" : {
"max_terms_count" : 2147483648
}
}
{
"error" : {
"root_cause" : [
{
"type" : "illegal_argument_exception",
"reason" : "Failed to parse value [2147483648] for setting [index.max_terms_count]"
}
],
"type" : "illegal_argument_exception",
"reason" : "Failed to parse value [2147483648] for setting [index.max_terms_count]",
"caused_by" : {
"type" : "number_format_exception",
"reason" : "For input string: \"2147483648\""
}
},
"status" : 400
}
因此,max_terms_count 确实在查询期间发挥作用,并且您的 index.max_terms_count 根据您的配置(有或没有默认)产生影响
关于elasticsearch - 设置 index.max_terms_count 没有效果?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54520671/
我正在使用 Gunicorn 为 Django 应用程序提供服务,它工作正常,直到我将其超时时间从 30 秒更改为 900000 秒,我不得不这样做,因为我有一个用例需要上传和处理一个巨大的文件(过程
我有一个带有非常基本的管道的Jenkinsfile,它可以旋转docker容器: pipeline { agent { dockerfile { args '-u root' } } stag
在学习 MEAN 堆栈的过程中,我遇到了一个问题。每当我尝试使用 Passport 验证方法时,它都不会返回任何响应。我总是收到“localhost没有发送任何数据。ERR_EMPTY_RESPONS
在当今的大多数企业堆栈中,数据库是我们存储所有秘密的地方。它是安全屋,是待命室,也是用于存储可能非常私密或极具价值的物品的集散地。对于依赖它的数据库管理员、程序员和DevOps团队来说,保护它免受所
是否可以创建像图片上那样的边框?只需使用 css 边框属性。最终结果将是没 Angular 盒子。我不想添加额外的 html 元素。我只想为每个 li 元素添加 css 边框信息。 假设这是一个 ul
我是一名优秀的程序员,十分优秀!