I'm trying to create a SearchRequest
with a MoreLikeThisQuery
like so:
JsonData jsonDocument = JsonData.of(document);
LikeDocument likeDocument = new LikeDocument.Builder().doc(jsonDocument).build();
MoreLikeThisQuery moreLikeThisQuery = QueryBuilders.moreLikeThis()
.like(new Like.Builder().document(likeDocument).build())
.build();
SearchRequest moreLikeThis = new SearchRequest.Builder()
.index("my-index")
.query(moreLikeThisQuery)
.build();
But I'm getting this compile error on the second to last line of that:
Cannot resolve method 'query(co.elastic.clients.elasticsearch._types.query_dsl.MoreLikeThisQuery)'
What am I doing wrong?
Thanks!