I want to remove the search trace from elastic query response as below:
Elastic query:
curl -u username:password elasticURL/elastic_index_name/_search?pretty&filter_path=hits.hits._source,agggregations.**.hits.hits._source
Elastic query response:
{
"hits": {
"hits": [
{
"_source": {
"column1": "data1",
"column2": "data2",
}
},
{
"_source": {
"column1": "data_1",
"column2": "data_2",
}
}]
},
"aggregations":{
"group_by_type": {
"buckets": [
"group_by_abc":{
"buckets":[
"group_by_xyz":{
"buckets":{
"group_doc":{
"hits": {
"hits": [
{
"_source" : {
"column1" : "data1",
"column2" : "data2"
}
},
"_source" : {
"column1" : "data_1",
"column2" : "data_2"
}
}
]
}
}
}
}
]
}
]
}
}
}
Expected Response:
{
"hits":[{
"_source": {
"column1": "data1",
"column2": "data2"
}
},
{
"_source": {
"column1": "data_1",
"column2": "data_2"
}
}],
"aggregations":[{
"_source" : {
"column1" : "data1",
"column2" : "data2"
}},
{"_source" : {
"column1" : "data_1",
"column2" : "data_2"
}}
]
}
I would like to know, whether it is achievable also or not.