there are 5 fields in each document if simply hit the api. but i want only these two fields(user_id and loc_code) so I mentioned in fields list. but still it return some unnecessary data like _shards,hits,time_out etc.
making POST request in postman plugin in chrome using below query
<:9200>/myindex/mytype/_search
{
"fields" : ["user_id", "loc_code"],
"query":{"term":{"group_id":"1sd323s"}}
}
// output
{
"took": 17,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 323,
"max_score": 8.402096,
"hits": [
{
"_index": "myindex",
"_type": "mytype",
"_id": "<someid>",
"_score": 8.402096,
"fields": {
"user_id": [
"<someuserid>"
],
"loc_code": [
768
]
}
},
...
]
}
}
but I want only documents fields(two mentioned fields) neither I want _id,_index,_type. is there any way to do so