亲,只收二进制

求教如何查询nested子字段值等于keyword类型字段值的文档

Elasticsearch | 作者 caster_QL | 发布于2022年10月26日 | 阅读数:1139

PUT test
{
"mappings": {
"properties": {
"b": {
"type": "keyword"
},
"nested": {
"type": "nested",
"properties": {
"a": {
"type": "keyword"
}
}
}
}
}
}
POST test/_search
{
"query": {
"nested": {
"path": "nested",
"query": {
"script": {
"script": """
doc['nested.a'].value == doc['b'].value
"""
}
}
}
}
}
类似这种DSL,但是nested script里面获取不到外部字段值
已邀请:

Charele - Cisco4321

赞同来自:

用父子文档

Charele - Cisco4321

赞同来自:

1234.png

要回复问题请先登录注册