与来源一起解析内部命中

Parsing inner hits along with source

我们在应用程序中使用 Jest java 客户端与 E.S 交互。

我们的文档结构如下:

{
  "productId":123,
  "reviews":[ // <============ NESTED
   {"id":1, "rating":3, "epoch":12345}
   {"id":2, "rating":4, "epoch":12346}
  ]
}

产品Class:

 class Product {
    int productId;
    List<Review> reviews; // Review class has id, rating and epoch
  }

我们必须 return 每个产品的最新评论。为此,我们使用 inner_hits 查询。

需要帮助: 我尽了最大努力,但我没有找到 JEST 客户端中的任何方法来解析 inner_hits 和源代码。

它还没有在 Jest 中实现。

一家issue两年前开过,今天还在开

看起来 Jest 至少可以说是“休眠”了...

您应该考虑利用 official High-Level Java REST client,因为它会像您期望的那样为 inner_hits 提供支持。