I am trying to implement inner hits with elasticsearch using Java API, but I cannot find much of any documentation on it or examples that other people are using. I have my JSON search that works as follows:
{
"query": {
"filtered": {
"query": {
"match_all": {}
},
"filter": {
"nested": {
"path": "locations",
"filter": {
"geo_distance": {
"distance": "20km",
"locations.address.geoLocation": {
"lat": 38.07061,
"lon": -76.77514
}
}
},
"inner_hits": {}
}
}
}
}
}
I see an InnerHitsBuilder and addInnerHit methods in the elasticsearch library but I cannot find the documentation on how to use them.