QueryBuilders.nestedQuery() updated in v5.6.2

I am upgrading the es to v5.6.2 from v2.3.3. As per the new api in es v5.6, a new parameter of type ScoreMode is expected.
In v2.3.3 the method signature used to be nestedQuery(String,QueryBuilder) which has changed to nestedQuery(String,QueryBuilder,ScroreMode) in es v5.6.2

Please find below the code-
NestedQueryBuilder nestedQueryBuilder = QueryBuilders.nestedQuery(field, entry.getValue().getBoolQueryBuilder());

below is the error i get during compilation-
method nestedQuery in class org.elasticsearch.index.query.QueryBuilders cannot be applied to given types;
required: java.lang.String,org.elasticsearch.index.query.QueryBuilder,org.apache.lucene.search.join.ScoreMode

What value can be passed for this parameter?
Please help :slight_smile:

I guess ScoreMode.None should work here. Please suggest in case you feel that this should not be the case.
Thanks :slight_smile:

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.