Elastic Search - java api for inner hit

那年仲夏 提交于 2019-12-24 04:58:43

问题


I made some query like below.

"query" : {
  "nested" : {
     "path" : "comments.votes",
     "query" : { ... },
     "inner_hits" : {}
  }
}

and I convert it as java api

QueryBuilders.boolQuery().must(
    boolQuery
)
.must( // error here if i changed as '.innerHit()'
    QueryBuilders.nestedQuery("comments.votes", 
        QueryBuilders.boolQuery().must( ... )
    )
    .innerHit( new QueryInnerHitBuilder()) // error here
)

It's how I made java code on ES version 2.x. Since I changed ES version 5.x, It's not functional at all. How should I changed it as ES 5.x version code?

来源:https://stackoverflow.com/questions/42103028/elastic-search-java-api-for-inner-hit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!