I want to use multi-field to remove duplicates datas,I gave it a try , but it didn't work . * I want to know how to use it on 7.9.3Version. please help me .
GET /test_2022_9/_search
{
"query": {
"bool": {
"filter": [
{
"match": {
"field1": "123"
}
},
{
"terms": {
"field2": [
"123",
"456"
]
}
},
{
"range": {
"field3": {
"gte": "2022-09-01 00:00:00",
"lte": "2022-09-08 23:59:59"
}
}
},
{
"match": {
"field4": 1
}
},
{
"wildcard": {
"field5": {
"value": "**"
}
}
}
]
}
},
"from": 0,
"size": 200,
"sort": [
{
"field2": {
"order": "desc"
}
},
{
"field3": {
"order": "asc"
}
}
],
"aggs": {
"job_count": {
"cardinality": {
"script": "doc['field2'].value + '#' + doc['field3'].value + '#' + doc['field4'].value",
"precision_threshold": 40000
}
}
},
"track_total_hits": true
}`Preformatted text`
`type or paste code here`