这就是我的文档在弹性搜索中的样子
{
"entityId": "CAMP_ID",
"txnId": "TXN_ID",
"changeSummary": [{
"field_name": "status_id",
"old_val": "1",
"new_val": "2"
}, {
"field_name": "budget",
"old_val": "100",
"new_val": "250"
}]
}
我得到了txnId列表和changeSummary.field_name列表,我必须得到所有匹配的文档。我最初尝试过这个查询:
{
"query" : {
"bool" : {
"should" : [ {
"terms" : {
"transactionId" : [ "2915315c03b3420280eae04116fb303f" ]
}
}, {
"terms" : {
"transactionId" : [ "18faf80b3eb44e4b85be993a6d5fd40b" ]
}
} ]
}
},
"post_filter" : {
"bool" : {
"must" : [ {
"match" : {
"changeSummary.fieldName" : "abc"
}
},{
"match" : {
"changeSummary.fieldName" : "xyz"
}
}]
}
}
}
这很好但我的问题是transactionId的列表可能真的很大,从10到1000000(甚至更多),如果transactionId列表的大小超过1024,那么我开始得到
too_many_clauses: maxClauseCount is set to 1024
有人可以帮忙吗?