diff --git a/server/src/main/java/org/opensearch/index/query/functionscore/ScriptScoreQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/functionscore/ScriptScoreQueryBuilder.java index fe9ad200d44f0..08461c323a8b2 100644 --- a/server/src/main/java/org/opensearch/index/query/functionscore/ScriptScoreQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/functionscore/ScriptScoreQueryBuilder.java @@ -227,11 +227,11 @@ protected void extractInnerHitBuilders(Map inner } @Override - public void visit(QueryBuilderVisitor visitor) { - visitor.accept(this); + public void visit(QueryBuilderVisitor visitor, int level) { + visitor.accept(this, level); if (query != null) { QueryBuilderVisitor subVisitor = visitor.getChildVisitor(BooleanClause.Occur.MUST); - subVisitor.accept(query); + subVisitor.accept(query, level+1); } } }