0
我有一个通用代码,生成Elasticsearch查询。在Elasticsearch查询中无用的部分
有没有性能损失在Elasticsearch查询具有无用部分:
在这个例子中,空"bool" : {}
部分
{
"post_filter": {
"bool": {
"must": [
{
"bool": {
"should": [
{
"term": {
"a": "a"
}
},
{
"term": {
"b": "b"
}
}
]
}
},
{
"bool": {}
}
]
}
}
}
,因为它可能没有must
写入,只有一个should
"post_filter": {
"bool": {
"should": {
…
}
}
}
或另一个ex充足:
"post_filter": {
"term": {
"a": "a"
}
}
是等值的性能
"post_filter": {
"bool": {
"must": {
"term": {
"a": "a"
}
}
}
}
我猜是,但任何人都可以证实?