gpt4 book ai didi

json - Elasticsearch 术语过滤器引发 "filter does not support [mediatest]"

转载 作者:行者123 更新时间:2023-11-29 02:44:46 25 4
gpt4 key购买 nike

我的查询是这样的:

{
"query": {
"filtered": {
"filter": {
"bool": {
"must": [
{
"term": {
"online": 1
}
},
{
"terms": {
"mediaType": "flash"
}
}
]
}
}
}
}
}

它引发 QueryParsingException [[comos_v2] [terms] 过滤器不支持 [mediaType]],其中“mediaType”字段在映射中完全不存在.我的问题是为什么术语过滤器不会引发异常?

最佳答案

以上不是有效的查询 DSL。在上面Terms filter “mediaType”字段的值应该是一个数组

应该是这样的:

{
"query": {
"filtered": {
"filter": {
"bool": {
"must": [
{
"term": {
"online": 1
}
},
{
"terms": {
"mediaType": ["flash"]
}
}
]
}
}
}
}
}

关于json - Elasticsearch 术语过滤器引发 "filter does not support [mediatest]",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30363647/

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