gpt4 book ai didi

elasticsearch - 如何从Elastic Search的query_string中排除ID数组?

转载 作者:行者123 更新时间:2023-12-02 22:24:26 25 4
gpt4 key购买 nike

我有这样的查询字符串:

"(( name_first.raw:goda )) AND !( _uid:*566ade1cec8d83647a000061* OR _uid:*566ade1cec8d83647a000062* OR _uid:*566ade1cec8d83647a000063* OR _uid:*566ade1cec8d83647a000064*)"

如何以更有效的方式编写此查询?

最佳答案

您可以使用以下查询:

POST <index>/<type>/_search
{
"query": {
"filtered": {
"query": {
"term": {
"name_first.raw": "goda"
}
},
"filter": {
"bool": {
"must_not": [
{
"terms": {
"_uid": [
"566ade1cec8d83647a000061",
"566ade1cec8d83647a000062",
"566ade1cec8d83647a000063"
]
}
}
]
}
}
}
}
}

关于elasticsearch - 如何从Elastic Search的query_string中排除ID数组?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34287934/

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