gpt4 book ai didi

elasticsearch - “query_string”在Elasticsearch中如何工作?

转载 作者:行者123 更新时间:2023-12-03 01:23:13 28 4
gpt4 key购买 nike

我在ES 5中具有以下映射的索引

{
"test-log": {
"mappings": {
"record": {
"properties": {
"content": {
"type": "text"
},
"level": {
"type": "keyword"
}
}
}
}
}
}

我索引这样的文件
POST test-log/record
{
"content":"this is about java and mysql",
"level":"info"
}

使用以下DSL,我可以获取数据
GET test-log/_search
{
"query": {
"query_string": {
"query": "info error"
}
}
}

然后我将ES升级到7.4
{
"test-log" : {
"mappings" : {
"properties" : {
"content" : {
"type" : "text"
},
"level" : {
"type" : "keyword"
}
}
}
}
}


但是我得到的结果是空的。

那么query_string在ES 7中如何工作?

ES 5和7之间有什么区别?

最佳答案

根据the documentation,您可能需要"query": "info OR error"

关于elasticsearch - “query_string”在Elasticsearch中如何工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59284645/

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