diff --git a/src/main/java/org/opensearch/neuralsearch/query/HybridQueryBuilder.java b/src/main/java/org/opensearch/neuralsearch/query/HybridQueryBuilder.java index a7da508bf..aa4242c2e 100644 --- a/src/main/java/org/opensearch/neuralsearch/query/HybridQueryBuilder.java +++ b/src/main/java/org/opensearch/neuralsearch/query/HybridQueryBuilder.java @@ -304,6 +304,8 @@ private Collection toQueries(Collection queryBuilders, Quer @Override public void visit(QueryBuilderVisitor visitor) { visitor.accept(this); + // getChildVisitor of NeuralSearchQueryVisitor return this. + // therefore any argument can be passed. Here we have used Occcur.MUST as an argument. QueryBuilderVisitor subVisitor = visitor.getChildVisitor(Occur.MUST); for (QueryBuilder subQueryBuilder : queries) { subQueryBuilder.visit(subVisitor);