gpt4 book ai didi

php - 范围字符串为整数

转载 作者:行者123 更新时间:2023-12-03 00:08:44 24 4
gpt4 key购买 nike

假设我们有 Post 索引,该索引具有嵌套的参数字段,并具有严格的映射并具有以下结构

    "parameters": {
"type": "nested",
"dynamic": "strict",
"properties": {
"kind": {
"type": "text",
"include_in_all": false
},
"label": {
"type": "text",
"include_in_all": false
},
"name": {
"type": "text",
"include_in_all": false
},
"option_id": {
"type": "text",
"include_in_all": false
},
"value": {
"type": "text",
"include_in_all": true
}
}
},

Value属性可以处理整数,浮点和字符串值。但是,现在我必须按 parameters.value 筛选帖子,尤其是使用 范围查询(parameters.value> $ needing_value)。我尝试使用 range query。根据 documentation 参数,值将按字典顺序进行过滤。但是我需要搜索为整数。所以我该怎么做才能达到目标。

最佳答案

我认为唯一自然的方法是在不同的属性中索引不同的类型。您可以使用https://www.elastic.co/guide/en/elasticsearch/reference/current/multi-fields.html

关于php - 范围字符串为整数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42646669/

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