From 929ef7df2aff37cdaa2e19e0c51214371c35fab4 Mon Sep 17 00:00:00 2001 From: Siddhant Deshmukh Date: Mon, 16 Oct 2023 14:32:46 -0700 Subject: [PATCH] Refactoring and renaming Signed-off-by: Siddhant Deshmukh --- ...Categorizor.java => SearchQueryCategorizer.java} | 10 +++++----- .../action/search/TransportSearchAction.java | 8 ++++---- .../org/opensearch/common/util/FeatureFlags.java | 13 +------------ 3 files changed, 10 insertions(+), 21 deletions(-) rename server/src/main/java/org/opensearch/action/search/{SearchQueryCategorizor.java => SearchQueryCategorizer.java} (90%) diff --git a/server/src/main/java/org/opensearch/action/search/SearchQueryCategorizor.java b/server/src/main/java/org/opensearch/action/search/SearchQueryCategorizer.java similarity index 90% rename from server/src/main/java/org/opensearch/action/search/SearchQueryCategorizor.java rename to server/src/main/java/org/opensearch/action/search/SearchQueryCategorizer.java index 9f6e4de95a704..bfe96be3e05d1 100644 --- a/server/src/main/java/org/opensearch/action/search/SearchQueryCategorizor.java +++ b/server/src/main/java/org/opensearch/action/search/SearchQueryCategorizer.java @@ -24,13 +24,13 @@ * Class to categorize the search queries based on the type and increment the relevant counters. * Class also logs the query shape. */ -public class SearchQueryCategorizor { +public class SearchQueryCategorizer { - private static final Logger log = LogManager.getLogger(SearchQueryCategorizor.class); + private static final Logger log = LogManager.getLogger(SearchQueryCategorizer.class); public SearchQueryCounters searchQueryCounters; - public SearchQueryCategorizor(MetricsRegistry metricsRegistry) { + public SearchQueryCategorizer(MetricsRegistry metricsRegistry) { searchQueryCounters = new SearchQueryCounters(metricsRegistry); } @@ -71,8 +71,8 @@ private void logQueryShape(QueryBuilder topLevelQueryBuilder) { } QueryShapeVisitor shapeVisitor = new QueryShapeVisitor(); topLevelQueryBuilder.visit(shapeVisitor); - String queryShapeJson = shapeVisitor.prettyPrintTree(" "); - log.debug("Query shape : " + queryShapeJson); + String indentedQueryShape = shapeVisitor.prettyPrintTree(" "); + log.debug("Query shape : " + indentedQueryShape); } } diff --git a/server/src/main/java/org/opensearch/action/search/TransportSearchAction.java b/server/src/main/java/org/opensearch/action/search/TransportSearchAction.java index 632abad2b06d1..cf04d9b2618df 100644 --- a/server/src/main/java/org/opensearch/action/search/TransportSearchAction.java +++ b/server/src/main/java/org/opensearch/action/search/TransportSearchAction.java @@ -191,7 +191,7 @@ public class TransportSearchAction extends HandledTransportAction featureFlag) { true, Property.NodeScope ); - - public static final Setting QUERY_CATEGORIZATION_SETTING = Setting.boolSetting( - QUERY_CATEOGORIZATION, - false, - Property.NodeScope - ); }