gpt4 book ai didi

elasticsearch - 在Elasticsearch的_all字段上进行通配符查询

转载 作者:行者123 更新时间:2023-12-02 23:00:07 25 4
gpt4 key购买 nike

我正在尝试对_all字段执行通配符查询。查询示例可能是:

GET index/type/_search
{
"from" : 0,
"size" : 1000,
"query" : {
"bool" : {
"must" : {
"wildcard" : {
"_all" : "*tito*"
}
}
}
}
}

事实是,要使用通配符查询,必须不分析_all字段,否则查询将无法工作。有关更多信息,请参见 ES documentation

我试图使用此请求设置 mappings over the _all field:
PUT index
{
"mappings": {
"type": {
"_all" : {
"enabled" : true,
"index_analyzer": "not_analyzed",
"search_analyzer": "not_analyzed"
},
"_timestamp": {
"enabled": "true"
},
"properties": {
"someProp": {
"type": "date"
}
}
}
}
}

但是我发现字段[_all] 的错误 分析器[not_analyzed]找不到。

我想知道我在做什么错,以及是否还有另一种(更好的)方式来执行这种查询。

谢谢。-

最佳答案

您是否尝试删除:

"search_analyzer": "not_analyzed"

另外,我想知道所有属性之间的通配符可扩展性如何。您是否研究过NGrams?参见文档 here

关于elasticsearch - 在Elasticsearch的_all字段上进行通配符查询,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36362911/

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