We are using Jest java client for interacting with E.S in our application.
We have a document structure like below :
{
"productId":123,
"reviews":[ // <============ NESTED
{"id":1, "rating":3, "epoch":12345}
{"id":2, "rating":4, "epoch":12346}
]
}
Product Class:
class Product {
int productId;
List<Review> reviews; // Review class has id, rating and epoch
}
We have to return the most recent review for each product. For that, we are using inner_hits query.
Help needed for: I tried my best but I didn't find any method with-in JEST client to parse inner_hits along with the source.