Thus, my data in elasticsearch looks as follows: one identifier of one person is equal to one doctor and contains a list of objects of type
`{
"dummy_name": "abc",
"dummy_id": "44850642"
}`
which is shown below, the fact is that I request in the field dummy_id
, and I get the result, since some are not. matching query results, and I want to aggregate in the field dummy_id
, so I don’t get documents for a specific one dummy_id
, but what happens, I also get buckets dummy_id
that are not mentioned in asking for his “I”, because the person contains a list of objects in which he is present dummy_id
.
`{
"person_id": 1234,
"Properties": {
"Property1": [
{
"dummy_name": "abc",
"dummy_id": "44850642"
},
{
},
{
}
]
}
},
{
"person_id": 1235,
.........
}`
Iam using:
`{
"query": {
"bool": {
"must": [
{
"match": {
"Properties.Property1.dummy_id": "453041 23234324 124324 "
}
}
]
}
},
"aggregations": {
"group_by_concept": {
"terms": {
"field": "Properties.Property1.dummy_id",
"order": {
"_count": "desc"
},
"size": 10
}
}
}
}`
source
share