diff --git a/server/src/main/java/org/opensearch/action/search/SearchQueryCategorizingVisitor.java b/server/src/main/java/org/opensearch/action/search/SearchQueryCategorizingVisitor.java index 0610ad44970d8..d03999fe4cc51 100644 --- a/server/src/main/java/org/opensearch/action/search/SearchQueryCategorizingVisitor.java +++ b/server/src/main/java/org/opensearch/action/search/SearchQueryCategorizingVisitor.java @@ -78,7 +78,8 @@ public void accept(QueryBuilder qb) { searchQueryCounters.termCounter.add(1, Tags.create().addTag(LEVEL_TAG, level)); } else if (qb instanceof WildcardQueryBuilder) { searchQueryCounters.wildcardCounter.add(1, Tags.create().addTag(LEVEL_TAG, level)); - } if (qb instanceof BoostingQueryBuilder) { + } + if (qb instanceof BoostingQueryBuilder) { searchQueryCounters.boostCounter.add(1, Tags.create().addTag(LEVEL_TAG, level)); } else if (qb instanceof ConstantScoreQueryBuilder) { searchQueryCounters.constantScoreCounter.add(1, Tags.create().addTag(LEVEL_TAG, level)); diff --git a/server/src/test/java/org/opensearch/action/search/SearchQueryCategorizerTests.java b/server/src/test/java/org/opensearch/action/search/SearchQueryCategorizerTests.java index 01ad255be763c..c3b49ac22894c 100644 --- a/server/src/test/java/org/opensearch/action/search/SearchQueryCategorizerTests.java +++ b/server/src/test/java/org/opensearch/action/search/SearchQueryCategorizerTests.java @@ -8,7 +8,6 @@ package org.opensearch.action.search; -import org.mockito.ArgumentCaptor; import org.opensearch.index.query.BoolQueryBuilder; import org.opensearch.index.query.BoostingQueryBuilder; import org.opensearch.index.query.MatchNoneQueryBuilder; @@ -35,7 +34,7 @@ import java.util.Arrays; -import org.mockito.Mockito; +import org.mockito.ArgumentCaptor; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq;