From 1118dcf3727b6a2dee598159d65560adfc4d0dec Mon Sep 17 00:00:00 2001 From: Nick Knize Date: Mon, 9 May 2022 14:05:59 -0500 Subject: [PATCH] [Javadocs] add to o.o.dfs,fetch,internal,lookup,profile, and query packages (#3261) Adds class level javadocs to org.opensearch.dfs, fetch, internal, lookup, profile, and query packages. Signed-off-by: Nicholas Walter Knize --- .../main/java/org/opensearch/search/dfs/AggregatedDfs.java | 5 +++++ .../src/main/java/org/opensearch/search/dfs/DfsPhase.java | 2 ++ .../opensearch/search/dfs/DfsPhaseExecutionException.java | 5 +++++ .../java/org/opensearch/search/dfs/DfsSearchResult.java | 5 +++++ .../main/java/org/opensearch/search/fetch/FetchContext.java | 2 ++ .../main/java/org/opensearch/search/fetch/FetchPhase.java | 2 ++ .../search/fetch/FetchPhaseExecutionException.java | 5 +++++ .../java/org/opensearch/search/fetch/FetchSearchResult.java | 5 +++++ .../java/org/opensearch/search/fetch/FetchSubPhase.java | 2 ++ .../org/opensearch/search/fetch/FetchSubPhaseProcessor.java | 2 ++ .../org/opensearch/search/fetch/QueryFetchSearchResult.java | 5 +++++ .../search/fetch/ScrollQueryFetchSearchResult.java | 5 +++++ .../java/org/opensearch/search/fetch/ShardFetchRequest.java | 2 ++ .../opensearch/search/fetch/ShardFetchSearchRequest.java | 2 ++ .../org/opensearch/search/fetch/StoredFieldsContext.java | 2 ++ .../org/opensearch/search/fetch/subphase/ExplainPhase.java | 2 ++ .../search/fetch/subphase/FetchDocValuesContext.java | 2 ++ .../search/fetch/subphase/FetchDocValuesPhase.java | 2 ++ .../search/fetch/subphase/FetchFieldsContext.java | 2 ++ .../opensearch/search/fetch/subphase/FetchFieldsPhase.java | 2 ++ .../opensearch/search/fetch/subphase/FetchScorePhase.java | 5 +++++ .../search/fetch/subphase/FetchSourceContext.java | 2 ++ .../opensearch/search/fetch/subphase/FetchSourcePhase.java | 5 +++++ .../opensearch/search/fetch/subphase/FetchVersionPhase.java | 5 +++++ .../opensearch/search/fetch/subphase/FieldAndFormat.java | 2 ++ .../org/opensearch/search/fetch/subphase/FieldFetcher.java | 2 ++ .../opensearch/search/fetch/subphase/InnerHitsContext.java | 2 ++ .../opensearch/search/fetch/subphase/InnerHitsPhase.java | 5 +++++ .../search/fetch/subphase/MatchedQueriesPhase.java | 5 +++++ .../search/fetch/subphase/ScriptFieldsContext.java | 5 +++++ .../opensearch/search/fetch/subphase/ScriptFieldsPhase.java | 5 +++++ .../search/fetch/subphase/SeqNoPrimaryTermPhase.java | 5 +++++ .../subphase/highlight/AbstractHighlighterBuilder.java | 2 ++ .../search/fetch/subphase/highlight/CustomQueryScorer.java | 5 +++++ .../fetch/subphase/highlight/FastVectorHighlighter.java | 5 +++++ .../fetch/subphase/highlight/FieldHighlightContext.java | 5 +++++ .../fetch/subphase/highlight/FragmentBuilderHelper.java | 2 ++ .../search/fetch/subphase/highlight/HighlightBuilder.java | 2 ++ .../search/fetch/subphase/highlight/HighlightField.java | 2 ++ .../search/fetch/subphase/highlight/HighlightPhase.java | 5 +++++ .../search/fetch/subphase/highlight/HighlightUtils.java | 5 +++++ .../search/fetch/subphase/highlight/Highlighter.java | 2 ++ .../search/fetch/subphase/highlight/PlainHighlighter.java | 5 +++++ .../fetch/subphase/highlight/SearchHighlightContext.java | 5 +++++ .../fetch/subphase/highlight/SimpleFragmentsBuilder.java | 2 ++ .../highlight/SourceScoreOrderFragmentsBuilder.java | 5 +++++ .../subphase/highlight/SourceSimpleFragmentsBuilder.java | 5 +++++ .../search/fetch/subphase/highlight/UnifiedHighlighter.java | 5 +++++ .../java/org/opensearch/search/internal/AliasFilter.java | 2 ++ .../opensearch/search/internal/CancellableBulkScorer.java | 2 ++ .../opensearch/search/internal/ContextIndexSearcher.java | 2 ++ .../opensearch/search/internal/ExitableDirectoryReader.java | 2 ++ .../opensearch/search/internal/FilteredSearchContext.java | 5 +++++ .../search/internal/InternalScrollSearchRequest.java | 5 +++++ .../opensearch/search/internal/InternalSearchResponse.java | 2 ++ .../org/opensearch/search/internal/LegacyReaderContext.java | 5 +++++ .../java/org/opensearch/search/internal/ReaderContext.java | 2 ++ .../java/org/opensearch/search/internal/ScrollContext.java | 6 +++++- .../java/org/opensearch/search/internal/SearchContext.java | 2 ++ .../opensearch/search/internal/ShardSearchContextId.java | 5 +++++ .../org/opensearch/search/internal/ShardSearchRequest.java | 2 ++ .../org/opensearch/search/internal/SubSearchContext.java | 5 +++++ .../main/java/org/opensearch/search/lookup/DocLookup.java | 5 +++++ .../main/java/org/opensearch/search/lookup/FieldLookup.java | 5 +++++ .../java/org/opensearch/search/lookup/FieldsLookup.java | 5 +++++ .../java/org/opensearch/search/lookup/LeafDocLookup.java | 5 +++++ .../java/org/opensearch/search/lookup/LeafFieldsLookup.java | 5 +++++ .../java/org/opensearch/search/lookup/LeafSearchLookup.java | 2 ++ .../java/org/opensearch/search/lookup/SearchLookup.java | 5 +++++ .../java/org/opensearch/search/lookup/SourceLookup.java | 5 +++++ .../search/profile/AbstractInternalProfileTree.java | 5 +++++ .../opensearch/search/profile/AbstractProfileBreakdown.java | 2 ++ .../org/opensearch/search/profile/AbstractProfiler.java | 5 +++++ .../search/profile/ContextualProfileBreakdown.java | 2 ++ .../java/org/opensearch/search/profile/NetworkTime.java | 5 +++++ .../java/org/opensearch/search/profile/ProfileResult.java | 2 ++ .../org/opensearch/search/profile/ProfileShardResult.java | 5 +++++ .../main/java/org/opensearch/search/profile/Profilers.java | 6 +++++- .../search/profile/SearchProfileShardResults.java | 2 ++ .../src/main/java/org/opensearch/search/profile/Timer.java | 2 ++ .../profile/aggregation/AggregationProfileBreakdown.java | 2 ++ .../profile/aggregation/AggregationProfileShardResult.java | 2 ++ .../search/profile/aggregation/AggregationProfiler.java | 5 +++++ .../search/profile/aggregation/AggregationTimingType.java | 5 +++++ .../profile/aggregation/InternalAggregationProfileTree.java | 5 +++++ .../search/profile/aggregation/ProfilingAggregator.java | 3 +++ .../profile/aggregation/ProfilingLeafBucketCollector.java | 5 +++++ .../opensearch/search/profile/query/CollectorResult.java | 2 ++ .../profile/query/ConcurrentQueryProfileBreakdown.java | 2 ++ .../search/profile/query/InternalProfileCollector.java | 2 ++ .../profile/query/InternalProfileCollectorManager.java | 5 +++++ .../search/profile/query/InternalProfileComponent.java | 5 +++++ .../search/profile/query/InternalQueryProfileTree.java | 2 ++ .../opensearch/search/profile/query/ProfileCollector.java | 6 +++++- .../search/profile/query/ProfileCollectorManager.java | 2 ++ .../org/opensearch/search/profile/query/ProfileScorer.java | 2 ++ .../org/opensearch/search/profile/query/ProfileWeight.java | 2 ++ .../search/profile/query/QueryProfileBreakdown.java | 2 ++ .../search/profile/query/QueryProfileShardResult.java | 2 ++ .../org/opensearch/search/profile/query/QueryProfiler.java | 2 ++ .../opensearch/search/profile/query/QueryTimingType.java | 5 +++++ .../opensearch/search/query/EarlyTerminatingCollector.java | 2 ++ .../search/query/EarlyTerminatingCollectorManager.java | 5 +++++ .../opensearch/search/query/EarlyTerminatingListener.java | 2 ++ .../opensearch/search/query/FilteredCollectorManager.java | 5 +++++ .../opensearch/search/query/MinimumCollectorManager.java | 3 +++ .../org/opensearch/search/query/MultiCollectorWrapper.java | 2 ++ .../org/opensearch/search/query/QueryCollectorContext.java | 5 +++++ .../search/query/QueryCollectorManagerContext.java | 5 +++++ .../main/java/org/opensearch/search/query/QueryPhase.java | 2 ++ .../search/query/QueryPhaseExecutionException.java | 5 +++++ .../org/opensearch/search/query/QueryPhaseSearcher.java | 2 ++ .../org/opensearch/search/query/QuerySearchRequest.java | 5 +++++ .../java/org/opensearch/search/query/QuerySearchResult.java | 5 +++++ .../org/opensearch/search/query/ReduceableSearchResult.java | 2 ++ .../opensearch/search/query/ScrollQuerySearchResult.java | 5 +++++ .../opensearch/search/query/TopDocsCollectorContext.java | 2 ++ .../search/query/TotalHitCountCollectorManager.java | 5 +++++ 118 files changed, 418 insertions(+), 3 deletions(-) diff --git a/server/src/main/java/org/opensearch/search/dfs/AggregatedDfs.java b/server/src/main/java/org/opensearch/search/dfs/AggregatedDfs.java index 0c1cba2c84c..c4d159187bb 100644 --- a/server/src/main/java/org/opensearch/search/dfs/AggregatedDfs.java +++ b/server/src/main/java/org/opensearch/search/dfs/AggregatedDfs.java @@ -44,6 +44,11 @@ import org.opensearch.common.io.stream.Writeable; import java.io.IOException; +/** + * Compute global distributed frequency across the index + * + * @opensearch.internal + */ public class AggregatedDfs implements Writeable { private ObjectObjectHashMap termStatistics; diff --git a/server/src/main/java/org/opensearch/search/dfs/DfsPhase.java b/server/src/main/java/org/opensearch/search/dfs/DfsPhase.java index 72ccc1fd5ac..6814fbd6e32 100644 --- a/server/src/main/java/org/opensearch/search/dfs/DfsPhase.java +++ b/server/src/main/java/org/opensearch/search/dfs/DfsPhase.java @@ -51,6 +51,8 @@ import java.util.Map; /** * Dfs phase of a search request, used to make scoring 100% accurate by collecting additional info from each shard before the query phase. * The additional information is used to better compare the scores coming from all the shards, which depend on local factors (e.g. idf) + * + * @opensearch.internal */ public class DfsPhase { diff --git a/server/src/main/java/org/opensearch/search/dfs/DfsPhaseExecutionException.java b/server/src/main/java/org/opensearch/search/dfs/DfsPhaseExecutionException.java index 9344672c168..2572bc1a73b 100644 --- a/server/src/main/java/org/opensearch/search/dfs/DfsPhaseExecutionException.java +++ b/server/src/main/java/org/opensearch/search/dfs/DfsPhaseExecutionException.java @@ -38,6 +38,11 @@ import org.opensearch.search.SearchShardTarget; import java.io.IOException; +/** + * Thrown if there are any errors in the DFS phase + * + * @opensearch.internal + */ public class DfsPhaseExecutionException extends SearchException { public DfsPhaseExecutionException(SearchShardTarget shardTarget, String msg, Throwable t) { diff --git a/server/src/main/java/org/opensearch/search/dfs/DfsSearchResult.java b/server/src/main/java/org/opensearch/search/dfs/DfsSearchResult.java index 48ab8aa6831..90cc547f62a 100644 --- a/server/src/main/java/org/opensearch/search/dfs/DfsSearchResult.java +++ b/server/src/main/java/org/opensearch/search/dfs/DfsSearchResult.java @@ -49,6 +49,11 @@ import org.opensearch.search.internal.ShardSearchRequest; import java.io.IOException; +/** + * Result from a Distributed Frequency Search phase + * + * @opensearch.internal + */ public class DfsSearchResult extends SearchPhaseResult { private static final Term[] EMPTY_TERMS = new Term[0]; diff --git a/server/src/main/java/org/opensearch/search/fetch/FetchContext.java b/server/src/main/java/org/opensearch/search/fetch/FetchContext.java index d26dbac33af..7e36ace9e21 100644 --- a/server/src/main/java/org/opensearch/search/fetch/FetchContext.java +++ b/server/src/main/java/org/opensearch/search/fetch/FetchContext.java @@ -57,6 +57,8 @@ import java.util.List; /** * Encapsulates state required to execute fetch phases + * + * @opensearch.internal */ public class FetchContext { diff --git a/server/src/main/java/org/opensearch/search/fetch/FetchPhase.java b/server/src/main/java/org/opensearch/search/fetch/FetchPhase.java index e50f903b229..4803184fa3a 100644 --- a/server/src/main/java/org/opensearch/search/fetch/FetchPhase.java +++ b/server/src/main/java/org/opensearch/search/fetch/FetchPhase.java @@ -90,6 +90,8 @@ import static java.util.Collections.emptyMap; /** * Fetch phase of a search request, used to fetch the actual top matching documents to be returned to the client, identified * after reducing all of the matches returned by the query phase + * + * @opensearch.internal */ public class FetchPhase { private static final Logger LOGGER = LogManager.getLogger(FetchPhase.class); diff --git a/server/src/main/java/org/opensearch/search/fetch/FetchPhaseExecutionException.java b/server/src/main/java/org/opensearch/search/fetch/FetchPhaseExecutionException.java index 4b9310edfef..b1a31525f70 100644 --- a/server/src/main/java/org/opensearch/search/fetch/FetchPhaseExecutionException.java +++ b/server/src/main/java/org/opensearch/search/fetch/FetchPhaseExecutionException.java @@ -38,6 +38,11 @@ import org.opensearch.search.SearchShardTarget; import java.io.IOException; +/** + * Thrown when there are errors during the fetch phase + * + * @opensearch.internal + */ public class FetchPhaseExecutionException extends SearchException { public FetchPhaseExecutionException(SearchShardTarget shardTarget, String msg, Throwable t) { diff --git a/server/src/main/java/org/opensearch/search/fetch/FetchSearchResult.java b/server/src/main/java/org/opensearch/search/fetch/FetchSearchResult.java index f4d4849a5a4..dcc7d60495a 100644 --- a/server/src/main/java/org/opensearch/search/fetch/FetchSearchResult.java +++ b/server/src/main/java/org/opensearch/search/fetch/FetchSearchResult.java @@ -43,6 +43,11 @@ import org.opensearch.search.query.QuerySearchResult; import java.io.IOException; +/** + * Result from a fetch + * + * @opensearch.internal + */ public final class FetchSearchResult extends SearchPhaseResult { private SearchHits hits; diff --git a/server/src/main/java/org/opensearch/search/fetch/FetchSubPhase.java b/server/src/main/java/org/opensearch/search/fetch/FetchSubPhase.java index 3c38249d886..744505ec98c 100644 --- a/server/src/main/java/org/opensearch/search/fetch/FetchSubPhase.java +++ b/server/src/main/java/org/opensearch/search/fetch/FetchSubPhase.java @@ -42,6 +42,8 @@ import java.io.IOException; /** * Sub phase within the fetch phase used to fetch things *about* the documents like highlighting or matched queries. + * + * @opensearch.internal */ public interface FetchSubPhase { diff --git a/server/src/main/java/org/opensearch/search/fetch/FetchSubPhaseProcessor.java b/server/src/main/java/org/opensearch/search/fetch/FetchSubPhaseProcessor.java index ce32cf62bec..6288861fff6 100644 --- a/server/src/main/java/org/opensearch/search/fetch/FetchSubPhaseProcessor.java +++ b/server/src/main/java/org/opensearch/search/fetch/FetchSubPhaseProcessor.java @@ -39,6 +39,8 @@ import java.io.IOException; /** * Executes the logic for a {@link FetchSubPhase} against a particular leaf reader and hit + * + * @opensearch.internal */ public interface FetchSubPhaseProcessor { diff --git a/server/src/main/java/org/opensearch/search/fetch/QueryFetchSearchResult.java b/server/src/main/java/org/opensearch/search/fetch/QueryFetchSearchResult.java index 5d655ce8a4f..047bf1b2074 100644 --- a/server/src/main/java/org/opensearch/search/fetch/QueryFetchSearchResult.java +++ b/server/src/main/java/org/opensearch/search/fetch/QueryFetchSearchResult.java @@ -41,6 +41,11 @@ import org.opensearch.search.query.QuerySearchResult; import java.io.IOException; +/** + * Query fetch result + * + * @opensearch.internal + */ public final class QueryFetchSearchResult extends SearchPhaseResult { private final QuerySearchResult queryResult; diff --git a/server/src/main/java/org/opensearch/search/fetch/ScrollQueryFetchSearchResult.java b/server/src/main/java/org/opensearch/search/fetch/ScrollQueryFetchSearchResult.java index 3156ccc11bc..cfba9ae461b 100644 --- a/server/src/main/java/org/opensearch/search/fetch/ScrollQueryFetchSearchResult.java +++ b/server/src/main/java/org/opensearch/search/fetch/ScrollQueryFetchSearchResult.java @@ -40,6 +40,11 @@ import org.opensearch.search.query.QuerySearchResult; import java.io.IOException; +/** + * Scroll fetch result + * + * @opensearch.internal + */ public final class ScrollQueryFetchSearchResult extends SearchPhaseResult { private final QueryFetchSearchResult result; diff --git a/server/src/main/java/org/opensearch/search/fetch/ShardFetchRequest.java b/server/src/main/java/org/opensearch/search/fetch/ShardFetchRequest.java index 65f595938a5..8bccc4425b4 100644 --- a/server/src/main/java/org/opensearch/search/fetch/ShardFetchRequest.java +++ b/server/src/main/java/org/opensearch/search/fetch/ShardFetchRequest.java @@ -54,6 +54,8 @@ import java.util.Map; /** * Shard level fetch base request. Holds all the info needed to execute a fetch. * Used with search scroll as the original request doesn't hold indices. + * + * @opensearch.internal */ public class ShardFetchRequest extends TransportRequest { diff --git a/server/src/main/java/org/opensearch/search/fetch/ShardFetchSearchRequest.java b/server/src/main/java/org/opensearch/search/fetch/ShardFetchSearchRequest.java index aadb13c1543..f3c52e3a6ab 100644 --- a/server/src/main/java/org/opensearch/search/fetch/ShardFetchSearchRequest.java +++ b/server/src/main/java/org/opensearch/search/fetch/ShardFetchSearchRequest.java @@ -50,6 +50,8 @@ import java.io.IOException; /** * Shard level fetch request used with search. Holds indices taken from the original search request * and implements {@link org.opensearch.action.IndicesRequest}. + * + * @opensearch.internal */ public class ShardFetchSearchRequest extends ShardFetchRequest implements IndicesRequest { diff --git a/server/src/main/java/org/opensearch/search/fetch/StoredFieldsContext.java b/server/src/main/java/org/opensearch/search/fetch/StoredFieldsContext.java index 225cfad2b61..56904a501eb 100644 --- a/server/src/main/java/org/opensearch/search/fetch/StoredFieldsContext.java +++ b/server/src/main/java/org/opensearch/search/fetch/StoredFieldsContext.java @@ -50,6 +50,8 @@ import java.util.Objects; /** * Context used to fetch the {@code stored_fields}. + * + * @opensearch.internal */ public class StoredFieldsContext implements Writeable { public static final String _NONE_ = "_none_"; diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/ExplainPhase.java b/server/src/main/java/org/opensearch/search/fetch/subphase/ExplainPhase.java index 42b2d6e94de..d34cc9bf494 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/ExplainPhase.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/ExplainPhase.java @@ -42,6 +42,8 @@ import java.io.IOException; /** * Explains the scoring calculations for the top hits. + * + * @opensearch.internal */ public final class ExplainPhase implements FetchSubPhase { diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/FetchDocValuesContext.java b/server/src/main/java/org/opensearch/search/fetch/subphase/FetchDocValuesContext.java index 3bfb3365fe4..ce5bd152cca 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/FetchDocValuesContext.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/FetchDocValuesContext.java @@ -41,6 +41,8 @@ import java.util.function.Function; /** * All the required context to pull a field from the doc values. + * + * @opensearch.internal */ public class FetchDocValuesContext { private final List fields; diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/FetchDocValuesPhase.java b/server/src/main/java/org/opensearch/search/fetch/subphase/FetchDocValuesPhase.java index b44d8560084..a8ab8c0dcb8 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/FetchDocValuesPhase.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/FetchDocValuesPhase.java @@ -49,6 +49,8 @@ import java.util.List; * Fetch sub phase which pulls data from doc values. * * Specifying {@code "docvalue_fields": ["field1", "field2"]} + * + * @opensearch.internal */ public final class FetchDocValuesPhase implements FetchSubPhase { diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/FetchFieldsContext.java b/server/src/main/java/org/opensearch/search/fetch/subphase/FetchFieldsContext.java index 5c481ccfef2..3803dedae9b 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/FetchFieldsContext.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/FetchFieldsContext.java @@ -35,6 +35,8 @@ import java.util.List; /** * The context needed to retrieve fields. + * + * @opensearch.internal */ public class FetchFieldsContext { private final List fields; diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/FetchFieldsPhase.java b/server/src/main/java/org/opensearch/search/fetch/subphase/FetchFieldsPhase.java index 353ec3f8080..0b15124f08c 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/FetchFieldsPhase.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/FetchFieldsPhase.java @@ -50,6 +50,8 @@ import java.util.Set; /** * A fetch sub-phase for high-level field retrieval. Given a list of fields, it * retrieves the field values from _source and returns them as document fields. + * + * @opensearch.internal */ public final class FetchFieldsPhase implements FetchSubPhase { diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/FetchScorePhase.java b/server/src/main/java/org/opensearch/search/fetch/subphase/FetchScorePhase.java index a83c994d91c..3516df482d3 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/FetchScorePhase.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/FetchScorePhase.java @@ -44,6 +44,11 @@ import org.opensearch.search.fetch.FetchSubPhaseProcessor; import java.io.IOException; +/** + * Fetches the score of a query match during search phase + * + * @opensearch.internal + */ public class FetchScorePhase implements FetchSubPhase { @Override diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/FetchSourceContext.java b/server/src/main/java/org/opensearch/search/fetch/subphase/FetchSourceContext.java index d8b803447c2..fe972028508 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/FetchSourceContext.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/FetchSourceContext.java @@ -54,6 +54,8 @@ import java.util.function.Function; /** * Context used to fetch the {@code _source}. + * + * @opensearch.internal */ public class FetchSourceContext implements Writeable, ToXContentObject { diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/FetchSourcePhase.java b/server/src/main/java/org/opensearch/search/fetch/subphase/FetchSourcePhase.java index 30274ac697a..f5c1e082c80 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/FetchSourcePhase.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/FetchSourcePhase.java @@ -46,6 +46,11 @@ import org.opensearch.search.lookup.SourceLookup; import java.io.IOException; import java.util.Map; +/** + * Fetches the document source during search phase + * + * @opensearch.internal + */ public final class FetchSourcePhase implements FetchSubPhase { @Override diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/FetchVersionPhase.java b/server/src/main/java/org/opensearch/search/fetch/subphase/FetchVersionPhase.java index d2d4740a32c..06d37531385 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/FetchVersionPhase.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/FetchVersionPhase.java @@ -41,6 +41,11 @@ import org.opensearch.search.fetch.FetchSubPhaseProcessor; import java.io.IOException; +/** + * Fetches the version of a term during search phase + * + * @opensearch.internal + */ public final class FetchVersionPhase implements FetchSubPhase { @Override diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/FieldAndFormat.java b/server/src/main/java/org/opensearch/search/fetch/subphase/FieldAndFormat.java index c87151170e1..225b697bad8 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/FieldAndFormat.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/FieldAndFormat.java @@ -49,6 +49,8 @@ import java.util.Objects; /** * Wrapper around a field name and the format that should be used to * display values of this field. + * + * @opensearch.internal */ public final class FieldAndFormat implements Writeable, ToXContentObject { private static final ParseField FIELD_FIELD = new ParseField("field"); diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/FieldFetcher.java b/server/src/main/java/org/opensearch/search/fetch/subphase/FieldFetcher.java index 6790a1a79d6..e2402c03c0b 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/FieldFetcher.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/FieldFetcher.java @@ -51,6 +51,8 @@ import java.util.Set; /** * A helper class to {@link FetchFieldsPhase} that's initialized with a list of field patterns to fetch. * Then given a specific document, it can retrieve the corresponding fields from the document's source. + * + * @opensearch.internal */ public class FieldFetcher { public static FieldFetcher create(QueryShardContext context, SearchLookup searchLookup, Collection fieldAndFormats) { diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/InnerHitsContext.java b/server/src/main/java/org/opensearch/search/fetch/subphase/InnerHitsContext.java index 22acd599d18..f50524244b1 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/InnerHitsContext.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/InnerHitsContext.java @@ -58,6 +58,8 @@ import java.util.Objects; /** * Context used for inner hits retrieval + * + * @opensearch.internal */ public final class InnerHitsContext { private final Map innerHits; diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/InnerHitsPhase.java b/server/src/main/java/org/opensearch/search/fetch/subphase/InnerHitsPhase.java index 56020d334a4..0b07dc35f13 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/InnerHitsPhase.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/InnerHitsPhase.java @@ -49,6 +49,11 @@ import java.io.IOException; import java.util.HashMap; import java.util.Map; +/** + * Gets the inner hits of a document during search + * + * @opensearch.internal + */ public final class InnerHitsPhase implements FetchSubPhase { private final FetchPhase fetchPhase; diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/MatchedQueriesPhase.java b/server/src/main/java/org/opensearch/search/fetch/subphase/MatchedQueriesPhase.java index 9d69d544887..6c589438d6b 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/MatchedQueriesPhase.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/MatchedQueriesPhase.java @@ -48,6 +48,11 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +/** + * Fetches queries that match the document during search phase + * + * @opensearch.internal + */ public final class MatchedQueriesPhase implements FetchSubPhase { @Override diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/ScriptFieldsContext.java b/server/src/main/java/org/opensearch/search/fetch/subphase/ScriptFieldsContext.java index e3a6c6951c4..04bbe945766 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/ScriptFieldsContext.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/ScriptFieldsContext.java @@ -37,6 +37,11 @@ import org.opensearch.script.FieldScript; import java.util.ArrayList; import java.util.List; +/** + * Context used for script fields + * + * @opensearch.internal + */ public class ScriptFieldsContext { public static class ScriptField { diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/ScriptFieldsPhase.java b/server/src/main/java/org/opensearch/search/fetch/subphase/ScriptFieldsPhase.java index d2425abbc09..aad20f0746f 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/ScriptFieldsPhase.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/ScriptFieldsPhase.java @@ -45,6 +45,11 @@ import java.util.Collection; import java.util.Collections; import java.util.List; +/** + * Gets the scripted fields during search phase + * + * @opensearch.internal + */ public final class ScriptFieldsPhase implements FetchSubPhase { @Override diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/SeqNoPrimaryTermPhase.java b/server/src/main/java/org/opensearch/search/fetch/subphase/SeqNoPrimaryTermPhase.java index fa020319919..b3926cfd70e 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/SeqNoPrimaryTermPhase.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/SeqNoPrimaryTermPhase.java @@ -41,6 +41,11 @@ import org.opensearch.search.fetch.FetchSubPhaseProcessor; import java.io.IOException; +/** + * Fetches the sequence number of the primary term during search phase + * + * @opensearch.internal + */ public final class SeqNoPrimaryTermPhase implements FetchSubPhase { @Override diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/AbstractHighlighterBuilder.java b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/AbstractHighlighterBuilder.java index acf065bc9c0..e935d46ea1f 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/AbstractHighlighterBuilder.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/AbstractHighlighterBuilder.java @@ -62,6 +62,8 @@ import static org.opensearch.index.query.AbstractQueryBuilder.parseInnerQueryBui /** * This abstract class holds parameters shared by {@link HighlightBuilder} and {@link HighlightBuilder.Field} * and provides the common setters, equality, hashCode calculation and common serialization + * + * @opensearch.internal */ public abstract class AbstractHighlighterBuilder> implements diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/CustomQueryScorer.java b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/CustomQueryScorer.java index 48db8a7f681..d0fb0f6da53 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/CustomQueryScorer.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/CustomQueryScorer.java @@ -43,6 +43,11 @@ import org.opensearch.index.search.OpenSearchToParentBlockJoinQuery; import java.io.IOException; import java.util.Map; +/** + * Internally used for custom scoring + * + * @opensearch.internal + */ public final class CustomQueryScorer extends QueryScorer { public CustomQueryScorer(Query query, IndexReader reader, String field, String defaultField) { diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/FastVectorHighlighter.java b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/FastVectorHighlighter.java index e5bfb5d2c94..77f8e82df50 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/FastVectorHighlighter.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/FastVectorHighlighter.java @@ -64,6 +64,11 @@ import java.util.Locale; import java.util.Map; import java.util.function.Function; +/** + * Uses Lucene's Fast Vector Highlighting + * + * @opensearch.internal + */ public class FastVectorHighlighter implements Highlighter { private static final BoundaryScanner DEFAULT_SIMPLE_BOUNDARY_SCANNER = new SimpleBoundaryScanner(); private static final BoundaryScanner DEFAULT_SENTENCE_BOUNDARY_SCANNER = new BreakIteratorBoundaryScanner( diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/FieldHighlightContext.java b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/FieldHighlightContext.java index 5d2758a04e7..2b4587fe6f4 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/FieldHighlightContext.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/FieldHighlightContext.java @@ -38,6 +38,11 @@ import org.opensearch.search.fetch.FetchSubPhase; import java.util.Map; +/** + * Context used during field level highlighting + * + * @opensearch.internal + */ public class FieldHighlightContext { public final String fieldName; diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/FragmentBuilderHelper.java b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/FragmentBuilderHelper.java index 1b1931c171a..e037ae5544a 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/FragmentBuilderHelper.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/FragmentBuilderHelper.java @@ -49,6 +49,8 @@ import java.util.List; /** * Simple helper class for {@link FastVectorHighlighter} {@link FragmentsBuilder} implementations. + * + * @opensearch.internal */ public final class FragmentBuilderHelper { diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/HighlightBuilder.java b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/HighlightBuilder.java index 1d998eeb578..7c2cc5ae1de 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/HighlightBuilder.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/HighlightBuilder.java @@ -67,6 +67,8 @@ import static org.opensearch.common.xcontent.ObjectParser.fromList; * are summarized to show only selected snippets ("fragments") containing search terms. * * @see org.opensearch.search.builder.SearchSourceBuilder#highlight() + * + * @opensearch.internal */ public class HighlightBuilder extends AbstractHighlighterBuilder { /** default for whether to highlight fields based on the source even if stored separately */ diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/HighlightField.java b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/HighlightField.java index 9cdcee3bfe8..638e1619a36 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/HighlightField.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/HighlightField.java @@ -51,6 +51,8 @@ import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedT /** * A field highlighted with its highlighted fragments. + * + * @opensearch.internal */ public class HighlightField implements ToXContentFragment, Writeable { diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/HighlightPhase.java b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/HighlightPhase.java index 4673477ac17..2fc9b214e3e 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/HighlightPhase.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/HighlightPhase.java @@ -51,6 +51,11 @@ import java.util.LinkedHashMap; import java.util.Map; import java.util.function.Function; +/** + * Highlight Phase of the search request. + * + * @opensearch.internal + */ public class HighlightPhase implements FetchSubPhase { private final Map highlighters; diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/HighlightUtils.java b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/HighlightUtils.java index 3265a339595..e37d56b1f86 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/HighlightUtils.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/HighlightUtils.java @@ -46,6 +46,11 @@ import java.util.List; import static java.util.Collections.singleton; +/** + * Utility class used during the highlight phase of the search request. + * + * @opensearch.internal + */ public final class HighlightUtils { // U+2029 PARAGRAPH SEPARATOR (PS): each value holds a discrete passage for highlighting (unified highlighter) diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/Highlighter.java b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/Highlighter.java index 417b2acd5fe..0c9bffde6c5 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/Highlighter.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/Highlighter.java @@ -37,6 +37,8 @@ import java.io.IOException; /** * Highlights a search result. + * + * @opensearch.internal */ public interface Highlighter { diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/PlainHighlighter.java b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/PlainHighlighter.java index d2699c650d8..f19039b2c0a 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/PlainHighlighter.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/PlainHighlighter.java @@ -61,6 +61,11 @@ import java.util.Map; import static org.opensearch.search.fetch.subphase.highlight.UnifiedHighlighter.convertFieldValue; +/** + * Standard Lucene Highlighter implementation + * + * @opensearch.internal + */ public class PlainHighlighter implements Highlighter { private static final String CACHE_KEY = "highlight-plain"; diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/SearchHighlightContext.java b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/SearchHighlightContext.java index 71c18d2217f..6072c738d9d 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/SearchHighlightContext.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/SearchHighlightContext.java @@ -43,6 +43,11 @@ import java.util.Locale; import java.util.Map; import java.util.Set; +/** + * Search context used during highlighting phase + * + * @opensearch.internal + */ public class SearchHighlightContext { private final Map fields; diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/SimpleFragmentsBuilder.java b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/SimpleFragmentsBuilder.java index 47a89b46999..89da5f6edbd 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/SimpleFragmentsBuilder.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/SimpleFragmentsBuilder.java @@ -40,6 +40,8 @@ import org.opensearch.index.mapper.MappedFieldType; /** * Direct Subclass of Lucene's org.apache.lucene.search.vectorhighlight.SimpleFragmentsBuilder * that corrects offsets for broken analysis chains. + * + * @opensearch.internal */ public class SimpleFragmentsBuilder extends org.apache.lucene.search.vectorhighlight.SimpleFragmentsBuilder { protected final MappedFieldType fieldType; diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/SourceScoreOrderFragmentsBuilder.java b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/SourceScoreOrderFragmentsBuilder.java index c62ef40a877..17866b0b697 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/SourceScoreOrderFragmentsBuilder.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/SourceScoreOrderFragmentsBuilder.java @@ -44,6 +44,11 @@ import org.opensearch.search.lookup.SourceLookup; import java.io.IOException; import java.util.List; +/** + * Internal builder used during source score lookup + * + * @opensearch.internal + */ public class SourceScoreOrderFragmentsBuilder extends ScoreOrderFragmentsBuilder { private final MappedFieldType fieldType; diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/SourceSimpleFragmentsBuilder.java b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/SourceSimpleFragmentsBuilder.java index aae0c78ed07..838883b18f7 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/SourceSimpleFragmentsBuilder.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/SourceSimpleFragmentsBuilder.java @@ -41,6 +41,11 @@ import org.opensearch.search.lookup.SourceLookup; import java.io.IOException; import java.util.List; +/** + * Internal builder used during simple highlighting + * + * @opensearch.internal + */ public class SourceSimpleFragmentsBuilder extends SimpleFragmentsBuilder { private final SourceLookup sourceLookup; diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/UnifiedHighlighter.java b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/UnifiedHighlighter.java index 8e97fc3a27f..ddf32064d7f 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/UnifiedHighlighter.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/UnifiedHighlighter.java @@ -66,6 +66,11 @@ import java.util.stream.Collectors; import static org.apache.lucene.search.uhighlight.CustomUnifiedHighlighter.MULTIVAL_SEP_CHAR; +/** + * Uses lucene's unified highlighter implementation + * + * @opensearch.internal + */ public class UnifiedHighlighter implements Highlighter { @Override public boolean canHighlight(MappedFieldType fieldType) { diff --git a/server/src/main/java/org/opensearch/search/internal/AliasFilter.java b/server/src/main/java/org/opensearch/search/internal/AliasFilter.java index b4864a9bedd..b0d8b3cf47b 100644 --- a/server/src/main/java/org/opensearch/search/internal/AliasFilter.java +++ b/server/src/main/java/org/opensearch/search/internal/AliasFilter.java @@ -46,6 +46,8 @@ import java.util.Objects; /** * Represents a {@link QueryBuilder} and a list of alias names that filters the builder is composed of. + * + * @opensearch.internal */ public final class AliasFilter implements Writeable, Rewriteable { diff --git a/server/src/main/java/org/opensearch/search/internal/CancellableBulkScorer.java b/server/src/main/java/org/opensearch/search/internal/CancellableBulkScorer.java index 2999f5aa547..585d0baba87 100644 --- a/server/src/main/java/org/opensearch/search/internal/CancellableBulkScorer.java +++ b/server/src/main/java/org/opensearch/search/internal/CancellableBulkScorer.java @@ -42,6 +42,8 @@ import java.util.Objects; /** * A {@link BulkScorer} wrapper that runs a {@link Runnable} on a regular basis * so that the query can be interrupted. + * + * @opensearch.internal */ final class CancellableBulkScorer extends BulkScorer { diff --git a/server/src/main/java/org/opensearch/search/internal/ContextIndexSearcher.java b/server/src/main/java/org/opensearch/search/internal/ContextIndexSearcher.java index 2fb5ababe19..efd288fd1cf 100644 --- a/server/src/main/java/org/opensearch/search/internal/ContextIndexSearcher.java +++ b/server/src/main/java/org/opensearch/search/internal/ContextIndexSearcher.java @@ -84,6 +84,8 @@ import java.util.concurrent.Executor; /** * Context-aware extension of {@link IndexSearcher}. + * + * @opensearch.internal */ public class ContextIndexSearcher extends IndexSearcher implements Releasable { /** diff --git a/server/src/main/java/org/opensearch/search/internal/ExitableDirectoryReader.java b/server/src/main/java/org/opensearch/search/internal/ExitableDirectoryReader.java index 9664fe3cb90..83ecd11a493 100644 --- a/server/src/main/java/org/opensearch/search/internal/ExitableDirectoryReader.java +++ b/server/src/main/java/org/opensearch/search/internal/ExitableDirectoryReader.java @@ -51,6 +51,8 @@ import java.io.IOException; /** * Wraps an {@link IndexReader} with a {@link QueryCancellation} * which checks for cancelled or timed-out query. + * + * @opensearch.internal */ class ExitableDirectoryReader extends FilterDirectoryReader { diff --git a/server/src/main/java/org/opensearch/search/internal/FilteredSearchContext.java b/server/src/main/java/org/opensearch/search/internal/FilteredSearchContext.java index 961d45b0011..ffb180614c3 100644 --- a/server/src/main/java/org/opensearch/search/internal/FilteredSearchContext.java +++ b/server/src/main/java/org/opensearch/search/internal/FilteredSearchContext.java @@ -70,6 +70,11 @@ import org.opensearch.search.suggest.SuggestionSearchContext; import java.util.List; import java.util.Map; +/** + * Context used during a filtered search + * + * @opensearch.internal + */ public abstract class FilteredSearchContext extends SearchContext { private final SearchContext in; diff --git a/server/src/main/java/org/opensearch/search/internal/InternalScrollSearchRequest.java b/server/src/main/java/org/opensearch/search/internal/InternalScrollSearchRequest.java index afa4dc7be7b..b546ba886a3 100644 --- a/server/src/main/java/org/opensearch/search/internal/InternalScrollSearchRequest.java +++ b/server/src/main/java/org/opensearch/search/internal/InternalScrollSearchRequest.java @@ -44,6 +44,11 @@ import org.opensearch.transport.TransportRequest; import java.io.IOException; import java.util.Map; +/** + * Internal request used during scroll search + * + * @opensearch.internal + */ public class InternalScrollSearchRequest extends TransportRequest { private ShardSearchContextId contextId; diff --git a/server/src/main/java/org/opensearch/search/internal/InternalSearchResponse.java b/server/src/main/java/org/opensearch/search/internal/InternalSearchResponse.java index 0f64adb37ab..fb36e856df3 100644 --- a/server/src/main/java/org/opensearch/search/internal/InternalSearchResponse.java +++ b/server/src/main/java/org/opensearch/search/internal/InternalSearchResponse.java @@ -46,6 +46,8 @@ import java.io.IOException; /** * {@link SearchResponseSections} subclass that can be serialized over the wire. + * + * @opensearch.internal */ public class InternalSearchResponse extends SearchResponseSections implements Writeable, ToXContentFragment { public static InternalSearchResponse empty() { diff --git a/server/src/main/java/org/opensearch/search/internal/LegacyReaderContext.java b/server/src/main/java/org/opensearch/search/internal/LegacyReaderContext.java index 7c3b36e9e55..05ab12d5ae8 100644 --- a/server/src/main/java/org/opensearch/search/internal/LegacyReaderContext.java +++ b/server/src/main/java/org/opensearch/search/internal/LegacyReaderContext.java @@ -40,6 +40,11 @@ import org.opensearch.search.dfs.AggregatedDfs; import java.util.Objects; +/** + * Reader context that does not hold a reference to a point in time Searcher + * + * @opensearch.internal + */ public class LegacyReaderContext extends ReaderContext { private final ShardSearchRequest shardSearchRequest; private final ScrollContext scrollContext; diff --git a/server/src/main/java/org/opensearch/search/internal/ReaderContext.java b/server/src/main/java/org/opensearch/search/internal/ReaderContext.java index 31d7a44d9bb..5bcc491f4ff 100644 --- a/server/src/main/java/org/opensearch/search/internal/ReaderContext.java +++ b/server/src/main/java/org/opensearch/search/internal/ReaderContext.java @@ -56,6 +56,8 @@ import java.util.concurrent.atomic.AtomicLong; * in {@link org.opensearch.search.SearchService} a SearchContext can be closed concurrently due to independent events * ie. when an index gets removed. To prevent accessing closed IndexReader / IndexSearcher instances the SearchContext * can be guarded by a reference count and fail if it's been closed by an external event. + * + * @opensearch.internal */ public class ReaderContext implements Releasable { private final ShardSearchContextId id; diff --git a/server/src/main/java/org/opensearch/search/internal/ScrollContext.java b/server/src/main/java/org/opensearch/search/internal/ScrollContext.java index 2df274d373b..ae4074930e0 100644 --- a/server/src/main/java/org/opensearch/search/internal/ScrollContext.java +++ b/server/src/main/java/org/opensearch/search/internal/ScrollContext.java @@ -36,7 +36,11 @@ import org.apache.lucene.search.ScoreDoc; import org.apache.lucene.search.TotalHits; import org.opensearch.search.Scroll; -/** Wrapper around information that needs to stay around when scrolling. */ +/** + * Wrapper around information that needs to stay around when scrolling. + * + * @opensearch.internal + */ public final class ScrollContext { public TotalHits totalHits = null; public float maxScore = Float.NaN; diff --git a/server/src/main/java/org/opensearch/search/internal/SearchContext.java b/server/src/main/java/org/opensearch/search/internal/SearchContext.java index 0c24fbee763..60438014f8d 100644 --- a/server/src/main/java/org/opensearch/search/internal/SearchContext.java +++ b/server/src/main/java/org/opensearch/search/internal/SearchContext.java @@ -83,6 +83,8 @@ import java.util.concurrent.atomic.AtomicBoolean; * This class encapsulates the state needed to execute a search. It holds a reference to the * shards point in time snapshot (IndexReader / ContextIndexSearcher) and allows passing on * state from one query / fetch phase to another. + * + * @opensearch.internal */ public abstract class SearchContext implements Releasable { diff --git a/server/src/main/java/org/opensearch/search/internal/ShardSearchContextId.java b/server/src/main/java/org/opensearch/search/internal/ShardSearchContextId.java index e9d1279915f..e3c946b5aae 100644 --- a/server/src/main/java/org/opensearch/search/internal/ShardSearchContextId.java +++ b/server/src/main/java/org/opensearch/search/internal/ShardSearchContextId.java @@ -40,6 +40,11 @@ import org.opensearch.common.io.stream.Writeable; import java.io.IOException; import java.util.Objects; +/** + * Used to support Point in Time Searching + * + * @opensearch.internal + */ public final class ShardSearchContextId implements Writeable { private final String sessionId; private final long id; diff --git a/server/src/main/java/org/opensearch/search/internal/ShardSearchRequest.java b/server/src/main/java/org/opensearch/search/internal/ShardSearchRequest.java index f41f7fae8b7..a4d7b2bed51 100644 --- a/server/src/main/java/org/opensearch/search/internal/ShardSearchRequest.java +++ b/server/src/main/java/org/opensearch/search/internal/ShardSearchRequest.java @@ -81,6 +81,8 @@ import static org.opensearch.search.internal.SearchContext.TRACK_TOTAL_HITS_DISA * Shard level request that represents a search. * It provides all the methods that the {@link SearchContext} needs. * Provides a cache key based on its content that can be used to cache shard level response. + * + * @opensearch.internal */ public class ShardSearchRequest extends TransportRequest implements IndicesRequest { private final String clusterAlias; diff --git a/server/src/main/java/org/opensearch/search/internal/SubSearchContext.java b/server/src/main/java/org/opensearch/search/internal/SubSearchContext.java index 842c6a514f1..55315013ea8 100644 --- a/server/src/main/java/org/opensearch/search/internal/SubSearchContext.java +++ b/server/src/main/java/org/opensearch/search/internal/SubSearchContext.java @@ -49,6 +49,11 @@ import org.opensearch.search.suggest.SuggestionSearchContext; import java.util.List; +/** + * Context for a sub search phase + * + * @opensearch.internal + */ public class SubSearchContext extends FilteredSearchContext { // By default return 3 hits per bucket. A higher default would make the response really large by default, since diff --git a/server/src/main/java/org/opensearch/search/lookup/DocLookup.java b/server/src/main/java/org/opensearch/search/lookup/DocLookup.java index 13e86c235db..069d9dd02ce 100644 --- a/server/src/main/java/org/opensearch/search/lookup/DocLookup.java +++ b/server/src/main/java/org/opensearch/search/lookup/DocLookup.java @@ -38,6 +38,11 @@ import org.opensearch.index.mapper.MapperService; import java.util.function.Function; +/** + * Looks up a document + * + * @opensearch.internal + */ public class DocLookup { private final MapperService mapperService; diff --git a/server/src/main/java/org/opensearch/search/lookup/FieldLookup.java b/server/src/main/java/org/opensearch/search/lookup/FieldLookup.java index 6d5b60d0162..6219c3bfb9e 100644 --- a/server/src/main/java/org/opensearch/search/lookup/FieldLookup.java +++ b/server/src/main/java/org/opensearch/search/lookup/FieldLookup.java @@ -37,6 +37,11 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; +/** + * Look up a field + * + * @opensearch.internal + */ public class FieldLookup { // we can cached fieldType completely per name, since its on an index/shard level (the lookup, and it does not change within the scope diff --git a/server/src/main/java/org/opensearch/search/lookup/FieldsLookup.java b/server/src/main/java/org/opensearch/search/lookup/FieldsLookup.java index 9af22c65aba..fff2f5f4c81 100644 --- a/server/src/main/java/org/opensearch/search/lookup/FieldsLookup.java +++ b/server/src/main/java/org/opensearch/search/lookup/FieldsLookup.java @@ -34,6 +34,11 @@ package org.opensearch.search.lookup; import org.apache.lucene.index.LeafReaderContext; import org.opensearch.index.mapper.MapperService; +/** + * looks up multiple fields from a leaf reader + * + * @opensearch.internal + */ public class FieldsLookup { private final MapperService mapperService; diff --git a/server/src/main/java/org/opensearch/search/lookup/LeafDocLookup.java b/server/src/main/java/org/opensearch/search/lookup/LeafDocLookup.java index 716476101ac..fe911ed7996 100644 --- a/server/src/main/java/org/opensearch/search/lookup/LeafDocLookup.java +++ b/server/src/main/java/org/opensearch/search/lookup/LeafDocLookup.java @@ -47,6 +47,11 @@ import java.util.Map; import java.util.Set; import java.util.function.Function; +/** + * Looks up a doc from a leaf reader + * + * @opensearch.internal + */ public class LeafDocLookup implements Map> { private final Map> localCacheFieldData = new HashMap<>(4); diff --git a/server/src/main/java/org/opensearch/search/lookup/LeafFieldsLookup.java b/server/src/main/java/org/opensearch/search/lookup/LeafFieldsLookup.java index 62b040dfdc8..007ee49b3e6 100644 --- a/server/src/main/java/org/opensearch/search/lookup/LeafFieldsLookup.java +++ b/server/src/main/java/org/opensearch/search/lookup/LeafFieldsLookup.java @@ -47,6 +47,11 @@ import java.util.Set; import static java.util.Collections.singletonMap; +/** + * looks up multiple leaf fields + * + * @opensearch.internal + */ public class LeafFieldsLookup implements Map { private final MapperService mapperService; diff --git a/server/src/main/java/org/opensearch/search/lookup/LeafSearchLookup.java b/server/src/main/java/org/opensearch/search/lookup/LeafSearchLookup.java index 75a4d7c8d16..1c87f260530 100644 --- a/server/src/main/java/org/opensearch/search/lookup/LeafSearchLookup.java +++ b/server/src/main/java/org/opensearch/search/lookup/LeafSearchLookup.java @@ -41,6 +41,8 @@ import static java.util.Collections.unmodifiableMap; /** * Per-segment version of {@link SearchLookup}. + * + * @opensearch.internal */ public class LeafSearchLookup { diff --git a/server/src/main/java/org/opensearch/search/lookup/SearchLookup.java b/server/src/main/java/org/opensearch/search/lookup/SearchLookup.java index 11feb3f2f9e..898d34dc02c 100644 --- a/server/src/main/java/org/opensearch/search/lookup/SearchLookup.java +++ b/server/src/main/java/org/opensearch/search/lookup/SearchLookup.java @@ -44,6 +44,11 @@ import java.util.Set; import java.util.function.BiFunction; import java.util.function.Supplier; +/** + * Orchestrator class for search phase lookups + * + * @opensearch.internal + */ public class SearchLookup { /** * The maximum depth of field dependencies. diff --git a/server/src/main/java/org/opensearch/search/lookup/SourceLookup.java b/server/src/main/java/org/opensearch/search/lookup/SourceLookup.java index eea42bae174..fe95b78c72b 100644 --- a/server/src/main/java/org/opensearch/search/lookup/SourceLookup.java +++ b/server/src/main/java/org/opensearch/search/lookup/SourceLookup.java @@ -54,6 +54,11 @@ import java.util.Set; import static java.util.Collections.emptyMap; +/** + * Orchestrator class for source lookups + * + * @opensearch.internal + */ public class SourceLookup implements Map { private LeafReader reader; diff --git a/server/src/main/java/org/opensearch/search/profile/AbstractInternalProfileTree.java b/server/src/main/java/org/opensearch/search/profile/AbstractInternalProfileTree.java index e797f3749d5..4d0949624eb 100644 --- a/server/src/main/java/org/opensearch/search/profile/AbstractInternalProfileTree.java +++ b/server/src/main/java/org/opensearch/search/profile/AbstractInternalProfileTree.java @@ -40,6 +40,11 @@ import java.util.Collections; import java.util.Deque; import java.util.List; +/** + * Base class for a profiling tree. + * + * @opensearch.internal + */ public abstract class AbstractInternalProfileTree, E> { protected ArrayList breakdowns; diff --git a/server/src/main/java/org/opensearch/search/profile/AbstractProfileBreakdown.java b/server/src/main/java/org/opensearch/search/profile/AbstractProfileBreakdown.java index d3bbd4d59e5..a29d4f9a0ee 100644 --- a/server/src/main/java/org/opensearch/search/profile/AbstractProfileBreakdown.java +++ b/server/src/main/java/org/opensearch/search/profile/AbstractProfileBreakdown.java @@ -42,6 +42,8 @@ import static java.util.Collections.emptyMap; * A record of timings for the various operations that may happen during query execution. * A node's time may be composed of several internal attributes (rewriting, weighting, * scoring, etc). + * + * @opensearch.internal */ public abstract class AbstractProfileBreakdown> { diff --git a/server/src/main/java/org/opensearch/search/profile/AbstractProfiler.java b/server/src/main/java/org/opensearch/search/profile/AbstractProfiler.java index b8e8ad2924c..4db1cb87a23 100644 --- a/server/src/main/java/org/opensearch/search/profile/AbstractProfiler.java +++ b/server/src/main/java/org/opensearch/search/profile/AbstractProfiler.java @@ -34,6 +34,11 @@ package org.opensearch.search.profile; import java.util.List; +/** + * Base class for a profiler + * + * @opensearch.internal + */ public class AbstractProfiler, E> { protected final AbstractInternalProfileTree profileTree; diff --git a/server/src/main/java/org/opensearch/search/profile/ContextualProfileBreakdown.java b/server/src/main/java/org/opensearch/search/profile/ContextualProfileBreakdown.java index 42cb16e88b4..4f071f730cd 100644 --- a/server/src/main/java/org/opensearch/search/profile/ContextualProfileBreakdown.java +++ b/server/src/main/java/org/opensearch/search/profile/ContextualProfileBreakdown.java @@ -11,6 +11,8 @@ package org.opensearch.search.profile; /** * Provide contextual profile breakdowns which are associated with freestyle context. Used when concurrent * search over segments is activated and each collector needs own non-shareable profile breakdown instance. + * + * @opensearch.internal */ public abstract class ContextualProfileBreakdown> extends AbstractProfileBreakdown { public ContextualProfileBreakdown(Class clazz) { diff --git a/server/src/main/java/org/opensearch/search/profile/NetworkTime.java b/server/src/main/java/org/opensearch/search/profile/NetworkTime.java index 8a9c72af5dc..17ae53e8a58 100644 --- a/server/src/main/java/org/opensearch/search/profile/NetworkTime.java +++ b/server/src/main/java/org/opensearch/search/profile/NetworkTime.java @@ -15,6 +15,11 @@ import org.opensearch.common.io.stream.Writeable; import java.io.IOException; +/** + * Utility class to track time of network operations + * + * @opensearch.internal + */ public class NetworkTime implements Writeable { private long inboundNetworkTime; private long outboundNetworkTime; diff --git a/server/src/main/java/org/opensearch/search/profile/ProfileResult.java b/server/src/main/java/org/opensearch/search/profile/ProfileResult.java index ad14431797e..c05c574b779 100644 --- a/server/src/main/java/org/opensearch/search/profile/ProfileResult.java +++ b/server/src/main/java/org/opensearch/search/profile/ProfileResult.java @@ -61,6 +61,8 @@ import static org.opensearch.common.xcontent.ConstructingObjectParser.optionalCo *

* Each InternalProfileResult has a List of InternalProfileResults, which will contain * "children" queries if applicable + * + * @opensearch.internal */ public final class ProfileResult implements Writeable, ToXContentObject { static final ParseField TYPE = new ParseField("type"); diff --git a/server/src/main/java/org/opensearch/search/profile/ProfileShardResult.java b/server/src/main/java/org/opensearch/search/profile/ProfileShardResult.java index c368225473f..01a0612f14c 100644 --- a/server/src/main/java/org/opensearch/search/profile/ProfileShardResult.java +++ b/server/src/main/java/org/opensearch/search/profile/ProfileShardResult.java @@ -43,6 +43,11 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; +/** + * Shard level profile results + * + * @opensearch.internal + */ public class ProfileShardResult implements Writeable { private final List queryProfileResults; diff --git a/server/src/main/java/org/opensearch/search/profile/Profilers.java b/server/src/main/java/org/opensearch/search/profile/Profilers.java index 3cc9b1710d4..2bc2f3a5a39 100644 --- a/server/src/main/java/org/opensearch/search/profile/Profilers.java +++ b/server/src/main/java/org/opensearch/search/profile/Profilers.java @@ -40,7 +40,11 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; -/** Wrapper around all the profilers that makes management easier. */ +/** + * Wrapper around all the profilers that makes management easier. + * + * @opensearch.internal + */ public final class Profilers { private final ContextIndexSearcher searcher; diff --git a/server/src/main/java/org/opensearch/search/profile/SearchProfileShardResults.java b/server/src/main/java/org/opensearch/search/profile/SearchProfileShardResults.java index 4765b765190..32cabb5e163 100644 --- a/server/src/main/java/org/opensearch/search/profile/SearchProfileShardResults.java +++ b/server/src/main/java/org/opensearch/search/profile/SearchProfileShardResults.java @@ -57,6 +57,8 @@ import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedT /** * A container class to hold all the profile results across all shards. Internally * holds a map of shard ID -> Profiled results + * + * @opensearch.internal */ public final class SearchProfileShardResults implements Writeable, ToXContentFragment { private static final String SEARCHES_FIELD = "searches"; diff --git a/server/src/main/java/org/opensearch/search/profile/Timer.java b/server/src/main/java/org/opensearch/search/profile/Timer.java index d392110e533..231324b4a55 100644 --- a/server/src/main/java/org/opensearch/search/profile/Timer.java +++ b/server/src/main/java/org/opensearch/search/profile/Timer.java @@ -45,6 +45,8 @@ package org.opensearch.search.profile; * timer.stop(); * } * + * + * @opensearch.internal */ public class Timer { diff --git a/server/src/main/java/org/opensearch/search/profile/aggregation/AggregationProfileBreakdown.java b/server/src/main/java/org/opensearch/search/profile/aggregation/AggregationProfileBreakdown.java index 4c3b22a02cc..24eccba575e 100644 --- a/server/src/main/java/org/opensearch/search/profile/aggregation/AggregationProfileBreakdown.java +++ b/server/src/main/java/org/opensearch/search/profile/aggregation/AggregationProfileBreakdown.java @@ -41,6 +41,8 @@ import static java.util.Collections.unmodifiableMap; /** * {@linkplain AbstractProfileBreakdown} customized to work with aggregations. + * + * @opensearch.internal */ public class AggregationProfileBreakdown extends AbstractProfileBreakdown { private final Map extra = new HashMap<>(); diff --git a/server/src/main/java/org/opensearch/search/profile/aggregation/AggregationProfileShardResult.java b/server/src/main/java/org/opensearch/search/profile/aggregation/AggregationProfileShardResult.java index 1638b3ee4d8..de91fe8a855 100644 --- a/server/src/main/java/org/opensearch/search/profile/aggregation/AggregationProfileShardResult.java +++ b/server/src/main/java/org/opensearch/search/profile/aggregation/AggregationProfileShardResult.java @@ -50,6 +50,8 @@ import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedT /** * A container class to hold the profile results for a single shard in the request. * Contains a list of query profiles, a collector tree and a total rewrite tree. + * + * @opensearch.internal */ public final class AggregationProfileShardResult implements Writeable, ToXContentFragment { diff --git a/server/src/main/java/org/opensearch/search/profile/aggregation/AggregationProfiler.java b/server/src/main/java/org/opensearch/search/profile/aggregation/AggregationProfiler.java index 7a1115e8b9e..1d2cf424ee5 100644 --- a/server/src/main/java/org/opensearch/search/profile/aggregation/AggregationProfiler.java +++ b/server/src/main/java/org/opensearch/search/profile/aggregation/AggregationProfiler.java @@ -40,6 +40,11 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; +/** + * Main class to profile aggregations + * + * @opensearch.internal + */ public class AggregationProfiler extends AbstractProfiler { private final Map, AggregationProfileBreakdown> profileBreakdownLookup = new HashMap<>(); diff --git a/server/src/main/java/org/opensearch/search/profile/aggregation/AggregationTimingType.java b/server/src/main/java/org/opensearch/search/profile/aggregation/AggregationTimingType.java index d71ca06941f..8c5ea2613e9 100644 --- a/server/src/main/java/org/opensearch/search/profile/aggregation/AggregationTimingType.java +++ b/server/src/main/java/org/opensearch/search/profile/aggregation/AggregationTimingType.java @@ -34,6 +34,11 @@ package org.opensearch.search.profile.aggregation; import java.util.Locale; +/** + * Timing levels for aggregations + * + * @opensearch.internal + */ public enum AggregationTimingType { INITIALIZE, BUILD_LEAF_COLLECTOR, diff --git a/server/src/main/java/org/opensearch/search/profile/aggregation/InternalAggregationProfileTree.java b/server/src/main/java/org/opensearch/search/profile/aggregation/InternalAggregationProfileTree.java index 026d1aeaf96..36cfc53f41c 100644 --- a/server/src/main/java/org/opensearch/search/profile/aggregation/InternalAggregationProfileTree.java +++ b/server/src/main/java/org/opensearch/search/profile/aggregation/InternalAggregationProfileTree.java @@ -35,6 +35,11 @@ package org.opensearch.search.profile.aggregation; import org.opensearch.search.aggregations.Aggregator; import org.opensearch.search.profile.AbstractInternalProfileTree; +/** + * The profiling tree for different levels of agg profiling + * + * @opensearch.internal + */ public class InternalAggregationProfileTree extends AbstractInternalProfileTree { @Override diff --git a/server/src/main/java/org/opensearch/search/profile/aggregation/ProfilingAggregator.java b/server/src/main/java/org/opensearch/search/profile/aggregation/ProfilingAggregator.java index 8d1cebebf3d..a07dba125d6 100644 --- a/server/src/main/java/org/opensearch/search/profile/aggregation/ProfilingAggregator.java +++ b/server/src/main/java/org/opensearch/search/profile/aggregation/ProfilingAggregator.java @@ -45,6 +45,9 @@ import org.opensearch.search.sort.SortOrder; import java.io.IOException; import java.util.Iterator; +/** + * An aggregator that aggregates the performance profiling of other aggregations + */ public class ProfilingAggregator extends Aggregator { private final Aggregator delegate; diff --git a/server/src/main/java/org/opensearch/search/profile/aggregation/ProfilingLeafBucketCollector.java b/server/src/main/java/org/opensearch/search/profile/aggregation/ProfilingLeafBucketCollector.java index 17e451c09a5..56c79465c45 100644 --- a/server/src/main/java/org/opensearch/search/profile/aggregation/ProfilingLeafBucketCollector.java +++ b/server/src/main/java/org/opensearch/search/profile/aggregation/ProfilingLeafBucketCollector.java @@ -38,6 +38,11 @@ import org.opensearch.search.profile.Timer; import java.io.IOException; +/** + * The collector for the agg profiles + * + * @opensearch.internal + */ public class ProfilingLeafBucketCollector extends LeafBucketCollector { private LeafBucketCollector delegate; diff --git a/server/src/main/java/org/opensearch/search/profile/query/CollectorResult.java b/server/src/main/java/org/opensearch/search/profile/query/CollectorResult.java index 1366bfd79ab..8e513d47f66 100644 --- a/server/src/main/java/org/opensearch/search/profile/query/CollectorResult.java +++ b/server/src/main/java/org/opensearch/search/profile/query/CollectorResult.java @@ -53,6 +53,8 @@ import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedT * Public interface and serialization container for profiled timings of the * Collectors used in the search. Children CollectorResult's may be * embedded inside of a parent CollectorResult + * + * @opensearch.internal */ public class CollectorResult implements ToXContentObject, Writeable { diff --git a/server/src/main/java/org/opensearch/search/profile/query/ConcurrentQueryProfileBreakdown.java b/server/src/main/java/org/opensearch/search/profile/query/ConcurrentQueryProfileBreakdown.java index 08f43e72d73..74ef78bc93c 100644 --- a/server/src/main/java/org/opensearch/search/profile/query/ConcurrentQueryProfileBreakdown.java +++ b/server/src/main/java/org/opensearch/search/profile/query/ConcurrentQueryProfileBreakdown.java @@ -19,6 +19,8 @@ import java.util.concurrent.ConcurrentHashMap; * A record of timings for the various operations that may happen during query execution. * A node's time may be composed of several internal attributes (rewriting, weighting, * scoring, etc). The class supports profiling the concurrent search over segments. + * + * @opensearch.internal */ public final class ConcurrentQueryProfileBreakdown extends ContextualProfileBreakdown { private final Map> contexts = new ConcurrentHashMap<>(); diff --git a/server/src/main/java/org/opensearch/search/profile/query/InternalProfileCollector.java b/server/src/main/java/org/opensearch/search/profile/query/InternalProfileCollector.java index d6ada27cbf6..1300782ae11 100644 --- a/server/src/main/java/org/opensearch/search/profile/query/InternalProfileCollector.java +++ b/server/src/main/java/org/opensearch/search/profile/query/InternalProfileCollector.java @@ -50,6 +50,8 @@ import java.util.List; * - needsScores() * * InternalProfiler facilitates the linking of the Collector graph + * + * @opensearch.internal */ public class InternalProfileCollector implements Collector, InternalProfileComponent { diff --git a/server/src/main/java/org/opensearch/search/profile/query/InternalProfileCollectorManager.java b/server/src/main/java/org/opensearch/search/profile/query/InternalProfileCollectorManager.java index a35c22a6a24..2732b2ccffc 100644 --- a/server/src/main/java/org/opensearch/search/profile/query/InternalProfileCollectorManager.java +++ b/server/src/main/java/org/opensearch/search/profile/query/InternalProfileCollectorManager.java @@ -18,6 +18,11 @@ import java.util.ArrayList; import java.util.Collection; import java.util.List; +/** + * Collector Manager for internal agg profiling + * + * @opensearch.internal + */ public class InternalProfileCollectorManager implements ProfileCollectorManager, diff --git a/server/src/main/java/org/opensearch/search/profile/query/InternalProfileComponent.java b/server/src/main/java/org/opensearch/search/profile/query/InternalProfileComponent.java index 9d0d32960a8..1752d76e27f 100644 --- a/server/src/main/java/org/opensearch/search/profile/query/InternalProfileComponent.java +++ b/server/src/main/java/org/opensearch/search/profile/query/InternalProfileComponent.java @@ -10,6 +10,11 @@ package org.opensearch.search.profile.query; import java.util.Collection; +/** + * Container for an agg profiling component + * + * @opensearch.internal + */ public interface InternalProfileComponent { /** * @return profile component name diff --git a/server/src/main/java/org/opensearch/search/profile/query/InternalQueryProfileTree.java b/server/src/main/java/org/opensearch/search/profile/query/InternalQueryProfileTree.java index e72f70300e0..40c6a293844 100644 --- a/server/src/main/java/org/opensearch/search/profile/query/InternalQueryProfileTree.java +++ b/server/src/main/java/org/opensearch/search/profile/query/InternalQueryProfileTree.java @@ -41,6 +41,8 @@ import org.opensearch.search.profile.ProfileResult; * This class tracks the dependency tree for queries (scoring and rewriting) and * generates {@link QueryProfileBreakdown} for each node in the tree. It also finalizes the tree * and returns a list of {@link ProfileResult} that can be serialized back to the client + * + * @opensearch.internal */ final class InternalQueryProfileTree extends AbstractInternalProfileTree, Query> { diff --git a/server/src/main/java/org/opensearch/search/profile/query/ProfileCollector.java b/server/src/main/java/org/opensearch/search/profile/query/ProfileCollector.java index 299beb01aac..837145c287f 100644 --- a/server/src/main/java/org/opensearch/search/profile/query/ProfileCollector.java +++ b/server/src/main/java/org/opensearch/search/profile/query/ProfileCollector.java @@ -42,7 +42,11 @@ import org.apache.lucene.search.ScoreMode; import java.io.IOException; -/** A collector that profiles how much time is spent calling it. */ +/** + * A collector that profiles how much time is spent calling it. + * + * @opensearch.internal + */ final class ProfileCollector extends FilterCollector { private long time; diff --git a/server/src/main/java/org/opensearch/search/profile/query/ProfileCollectorManager.java b/server/src/main/java/org/opensearch/search/profile/query/ProfileCollectorManager.java index 7037988401f..5a8566e6dfa 100644 --- a/server/src/main/java/org/opensearch/search/profile/query/ProfileCollectorManager.java +++ b/server/src/main/java/org/opensearch/search/profile/query/ProfileCollectorManager.java @@ -13,5 +13,7 @@ import org.apache.lucene.search.CollectorManager; /** * Collector manager which supports profiling + * + * @opensearch.internal */ public interface ProfileCollectorManager extends CollectorManager, InternalProfileComponent {} diff --git a/server/src/main/java/org/opensearch/search/profile/query/ProfileScorer.java b/server/src/main/java/org/opensearch/search/profile/query/ProfileScorer.java index 3c0ddee7cfc..31928144919 100644 --- a/server/src/main/java/org/opensearch/search/profile/query/ProfileScorer.java +++ b/server/src/main/java/org/opensearch/search/profile/query/ProfileScorer.java @@ -45,6 +45,8 @@ import java.util.Collection; /** * {@link Scorer} wrapper that will compute how much time is spent on moving * the iterator, confirming matches and computing scores. + * + * @opensearch.internal */ final class ProfileScorer extends Scorer { diff --git a/server/src/main/java/org/opensearch/search/profile/query/ProfileWeight.java b/server/src/main/java/org/opensearch/search/profile/query/ProfileWeight.java index 56b69ab3fb2..12f9a7184d8 100644 --- a/server/src/main/java/org/opensearch/search/profile/query/ProfileWeight.java +++ b/server/src/main/java/org/opensearch/search/profile/query/ProfileWeight.java @@ -48,6 +48,8 @@ import java.io.IOException; * Weight wrapper that will compute how much time it takes to build the * {@link Scorer} and then return a {@link Scorer} that is wrapped in * order to compute timings as well. + * + * @opensearch.internal */ public final class ProfileWeight extends Weight { diff --git a/server/src/main/java/org/opensearch/search/profile/query/QueryProfileBreakdown.java b/server/src/main/java/org/opensearch/search/profile/query/QueryProfileBreakdown.java index 3e0ee8db4df..3514a80e39d 100644 --- a/server/src/main/java/org/opensearch/search/profile/query/QueryProfileBreakdown.java +++ b/server/src/main/java/org/opensearch/search/profile/query/QueryProfileBreakdown.java @@ -39,6 +39,8 @@ import org.opensearch.search.profile.ContextualProfileBreakdown; * A record of timings for the various operations that may happen during query execution. * A node's time may be composed of several internal attributes (rewriting, weighting, * scoring, etc). + * + * @opensearch.internal */ public final class QueryProfileBreakdown extends ContextualProfileBreakdown { diff --git a/server/src/main/java/org/opensearch/search/profile/query/QueryProfileShardResult.java b/server/src/main/java/org/opensearch/search/profile/query/QueryProfileShardResult.java index 283adddaba5..e77fef681c8 100644 --- a/server/src/main/java/org/opensearch/search/profile/query/QueryProfileShardResult.java +++ b/server/src/main/java/org/opensearch/search/profile/query/QueryProfileShardResult.java @@ -50,6 +50,8 @@ import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedT /** * A container class to hold the profile results for a single shard in the request. * Contains a list of query profiles, a collector tree and a total rewrite tree. + * + * @opensearch.internal */ public final class QueryProfileShardResult implements Writeable, ToXContentObject { diff --git a/server/src/main/java/org/opensearch/search/profile/query/QueryProfiler.java b/server/src/main/java/org/opensearch/search/profile/query/QueryProfiler.java index e7834771335..9527e010005 100644 --- a/server/src/main/java/org/opensearch/search/profile/query/QueryProfiler.java +++ b/server/src/main/java/org/opensearch/search/profile/query/QueryProfiler.java @@ -48,6 +48,8 @@ import java.util.Objects; * A Profiler is associated with every Search, not per Search-Request. E.g. a * request may execute two searches (query + global agg). A Profiler just * represents one of those + * + * @opensearch.internal */ public final class QueryProfiler extends AbstractProfiler, Query> { diff --git a/server/src/main/java/org/opensearch/search/profile/query/QueryTimingType.java b/server/src/main/java/org/opensearch/search/profile/query/QueryTimingType.java index 7748b76cb16..0cc7d1315ad 100644 --- a/server/src/main/java/org/opensearch/search/profile/query/QueryTimingType.java +++ b/server/src/main/java/org/opensearch/search/profile/query/QueryTimingType.java @@ -34,6 +34,11 @@ package org.opensearch.search.profile.query; import java.util.Locale; +/** + * Different profile levels of the query + * + * @opensearch.internal + */ public enum QueryTimingType { CREATE_WEIGHT, BUILD_SCORER, diff --git a/server/src/main/java/org/opensearch/search/query/EarlyTerminatingCollector.java b/server/src/main/java/org/opensearch/search/query/EarlyTerminatingCollector.java index 56cb49835dc..5b86a70d64f 100644 --- a/server/src/main/java/org/opensearch/search/query/EarlyTerminatingCollector.java +++ b/server/src/main/java/org/opensearch/search/query/EarlyTerminatingCollector.java @@ -43,6 +43,8 @@ import java.io.IOException; /** * A {@link Collector} that early terminates collection after maxCountHits docs have been collected. + * + * @opensearch.internal */ public class EarlyTerminatingCollector extends FilterCollector { static final class EarlyTerminationException extends RuntimeException { diff --git a/server/src/main/java/org/opensearch/search/query/EarlyTerminatingCollectorManager.java b/server/src/main/java/org/opensearch/search/query/EarlyTerminatingCollectorManager.java index 32fbb24d164..e8153fd384b 100644 --- a/server/src/main/java/org/opensearch/search/query/EarlyTerminatingCollectorManager.java +++ b/server/src/main/java/org/opensearch/search/query/EarlyTerminatingCollectorManager.java @@ -16,6 +16,11 @@ import java.util.ArrayList; import java.util.Collection; import java.util.List; +/** + * Manager for the EarlyTerminatingCollector + * + * @opensearch.internal + */ public class EarlyTerminatingCollectorManager implements CollectorManager, diff --git a/server/src/main/java/org/opensearch/search/query/EarlyTerminatingListener.java b/server/src/main/java/org/opensearch/search/query/EarlyTerminatingListener.java index dd6793266a7..340fb26923c 100644 --- a/server/src/main/java/org/opensearch/search/query/EarlyTerminatingListener.java +++ b/server/src/main/java/org/opensearch/search/query/EarlyTerminatingListener.java @@ -11,6 +11,8 @@ package org.opensearch.search.query; /** * Early termination event listener. It is used during concurrent segment search * to propagate the early termination intent. + * + * @opensearch.internal */ public interface EarlyTerminatingListener { /** diff --git a/server/src/main/java/org/opensearch/search/query/FilteredCollectorManager.java b/server/src/main/java/org/opensearch/search/query/FilteredCollectorManager.java index ef47cf2a388..96f449daf91 100644 --- a/server/src/main/java/org/opensearch/search/query/FilteredCollectorManager.java +++ b/server/src/main/java/org/opensearch/search/query/FilteredCollectorManager.java @@ -17,6 +17,11 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Collection; +/** + * Manager for the FilteredCollector + * + * @opensearch.internal + */ class FilteredCollectorManager implements CollectorManager { private final CollectorManager manager; private final Weight filter; diff --git a/server/src/main/java/org/opensearch/search/query/MinimumCollectorManager.java b/server/src/main/java/org/opensearch/search/query/MinimumCollectorManager.java index 22b25222b63..ed99f3dd8cc 100644 --- a/server/src/main/java/org/opensearch/search/query/MinimumCollectorManager.java +++ b/server/src/main/java/org/opensearch/search/query/MinimumCollectorManager.java @@ -16,6 +16,9 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Collection; +/** + * Manager for the MinimumCollector + */ class MinimumCollectorManager implements CollectorManager { private final CollectorManager manager; private final float minimumScore; diff --git a/server/src/main/java/org/opensearch/search/query/MultiCollectorWrapper.java b/server/src/main/java/org/opensearch/search/query/MultiCollectorWrapper.java index 0ee423b48ca..7c57193349b 100644 --- a/server/src/main/java/org/opensearch/search/query/MultiCollectorWrapper.java +++ b/server/src/main/java/org/opensearch/search/query/MultiCollectorWrapper.java @@ -22,6 +22,8 @@ import java.util.List; /** * Wraps MultiCollector and provide access to underlying collectors. * Please check out https://github.com/apache/lucene/pull/455. + * + * @opensearch.internal */ public class MultiCollectorWrapper implements Collector { private final MultiCollector delegate; diff --git a/server/src/main/java/org/opensearch/search/query/QueryCollectorContext.java b/server/src/main/java/org/opensearch/search/query/QueryCollectorContext.java index 95ad514adf9..9ce4a73c97c 100644 --- a/server/src/main/java/org/opensearch/search/query/QueryCollectorContext.java +++ b/server/src/main/java/org/opensearch/search/query/QueryCollectorContext.java @@ -56,6 +56,11 @@ import static org.opensearch.search.profile.query.CollectorResult.REASON_SEARCH_ import static org.opensearch.search.profile.query.CollectorResult.REASON_SEARCH_POST_FILTER; import static org.opensearch.search.profile.query.CollectorResult.REASON_SEARCH_TERMINATE_AFTER_COUNT; +/** + * The context used during query collection + * + * @opensearch.internal + */ public abstract class QueryCollectorContext { private static final Collector EMPTY_COLLECTOR = new SimpleCollector() { @Override diff --git a/server/src/main/java/org/opensearch/search/query/QueryCollectorManagerContext.java b/server/src/main/java/org/opensearch/search/query/QueryCollectorManagerContext.java index c98f4884bb0..3fa5003cdbf 100644 --- a/server/src/main/java/org/opensearch/search/query/QueryCollectorManagerContext.java +++ b/server/src/main/java/org/opensearch/search/query/QueryCollectorManagerContext.java @@ -19,6 +19,11 @@ import java.util.ArrayList; import java.util.Collection; import java.util.List; +/** + * Context used for the query collector manager + * + * @opensearch.internal + */ public abstract class QueryCollectorManagerContext { private static class QueryCollectorManager implements CollectorManager { private final MultiCollectorManager manager; diff --git a/server/src/main/java/org/opensearch/search/query/QueryPhase.java b/server/src/main/java/org/opensearch/search/query/QueryPhase.java index 1501067ec79..0b935baf641 100644 --- a/server/src/main/java/org/opensearch/search/query/QueryPhase.java +++ b/server/src/main/java/org/opensearch/search/query/QueryPhase.java @@ -84,6 +84,8 @@ import static org.opensearch.search.query.TopDocsCollectorContext.createTopDocsC /** * Query phase of a search request, used to run the query and get back from each shard information about the matching documents * (document ids and score or sort criteria) so that matches can be reduced on the coordinating node + * + * @opensearch.internal */ public class QueryPhase { private static final Logger LOGGER = LogManager.getLogger(QueryPhase.class); diff --git a/server/src/main/java/org/opensearch/search/query/QueryPhaseExecutionException.java b/server/src/main/java/org/opensearch/search/query/QueryPhaseExecutionException.java index 45d03839363..50dd5f04418 100644 --- a/server/src/main/java/org/opensearch/search/query/QueryPhaseExecutionException.java +++ b/server/src/main/java/org/opensearch/search/query/QueryPhaseExecutionException.java @@ -38,6 +38,11 @@ import org.opensearch.search.SearchShardTarget; import java.io.IOException; +/** + * Thrown if there are any errors in the query phase + * + * @opensearch.internal + */ public class QueryPhaseExecutionException extends SearchException { public QueryPhaseExecutionException(SearchShardTarget shardTarget, String msg, Throwable cause) { diff --git a/server/src/main/java/org/opensearch/search/query/QueryPhaseSearcher.java b/server/src/main/java/org/opensearch/search/query/QueryPhaseSearcher.java index 9a48f030fe1..1995137e8b5 100644 --- a/server/src/main/java/org/opensearch/search/query/QueryPhaseSearcher.java +++ b/server/src/main/java/org/opensearch/search/query/QueryPhaseSearcher.java @@ -19,6 +19,8 @@ import java.util.LinkedList; /** * The extension point which allows to plug in custom search implementation to be * used at {@link QueryPhase}. + * + * @opensearch.internal */ public interface QueryPhaseSearcher { /** diff --git a/server/src/main/java/org/opensearch/search/query/QuerySearchRequest.java b/server/src/main/java/org/opensearch/search/query/QuerySearchRequest.java index 0e7cacf0139..ae2f9e8fab9 100644 --- a/server/src/main/java/org/opensearch/search/query/QuerySearchRequest.java +++ b/server/src/main/java/org/opensearch/search/query/QuerySearchRequest.java @@ -51,6 +51,11 @@ import org.opensearch.transport.TransportRequest; import java.io.IOException; import java.util.Map; +/** + * Transport request for query search + * + * @opensearch.internal + */ public class QuerySearchRequest extends TransportRequest implements IndicesRequest { private final ShardSearchContextId contextId; diff --git a/server/src/main/java/org/opensearch/search/query/QuerySearchResult.java b/server/src/main/java/org/opensearch/search/query/QuerySearchResult.java index ee506bbc6ed..dceacd57d62 100644 --- a/server/src/main/java/org/opensearch/search/query/QuerySearchResult.java +++ b/server/src/main/java/org/opensearch/search/query/QuerySearchResult.java @@ -58,6 +58,11 @@ import static java.util.Collections.emptyList; import static org.opensearch.common.lucene.Lucene.readTopDocs; import static org.opensearch.common.lucene.Lucene.writeTopDocs; +/** + * The result of the query search + * + * @opensearch.internal + */ public final class QuerySearchResult extends SearchPhaseResult { private int from; diff --git a/server/src/main/java/org/opensearch/search/query/ReduceableSearchResult.java b/server/src/main/java/org/opensearch/search/query/ReduceableSearchResult.java index 48e8d7198ea..dbfaa70e196 100644 --- a/server/src/main/java/org/opensearch/search/query/ReduceableSearchResult.java +++ b/server/src/main/java/org/opensearch/search/query/ReduceableSearchResult.java @@ -12,6 +12,8 @@ import java.io.IOException; /** * The search result callback returned by reduce phase of the collector manager. + * + * @opensearch.internal */ public interface ReduceableSearchResult { /** diff --git a/server/src/main/java/org/opensearch/search/query/ScrollQuerySearchResult.java b/server/src/main/java/org/opensearch/search/query/ScrollQuerySearchResult.java index 278a1ee2b09..ef0827bd0b1 100644 --- a/server/src/main/java/org/opensearch/search/query/ScrollQuerySearchResult.java +++ b/server/src/main/java/org/opensearch/search/query/ScrollQuerySearchResult.java @@ -39,6 +39,11 @@ import org.opensearch.search.SearchShardTarget; import java.io.IOException; +/** + * Scrolled results from a query search request + * + * @opensearch.internal + */ public final class ScrollQuerySearchResult extends SearchPhaseResult { private final QuerySearchResult result; diff --git a/server/src/main/java/org/opensearch/search/query/TopDocsCollectorContext.java b/server/src/main/java/org/opensearch/search/query/TopDocsCollectorContext.java index 5f19462a2c3..39c34f7c0d5 100644 --- a/server/src/main/java/org/opensearch/search/query/TopDocsCollectorContext.java +++ b/server/src/main/java/org/opensearch/search/query/TopDocsCollectorContext.java @@ -92,6 +92,8 @@ import static org.opensearch.search.profile.query.CollectorResult.REASON_SEARCH_ /** * A {@link QueryCollectorContext} that creates top docs collector + * + * @opensearch.internal */ public abstract class TopDocsCollectorContext extends QueryCollectorContext { protected final int numHits; diff --git a/server/src/main/java/org/opensearch/search/query/TotalHitCountCollectorManager.java b/server/src/main/java/org/opensearch/search/query/TotalHitCountCollectorManager.java index 6d4159c9777..b8810c76bbc 100644 --- a/server/src/main/java/org/opensearch/search/query/TotalHitCountCollectorManager.java +++ b/server/src/main/java/org/opensearch/search/query/TotalHitCountCollectorManager.java @@ -21,6 +21,11 @@ import org.opensearch.common.lucene.search.TopDocsAndMaxScore; import java.io.IOException; import java.util.Collection; +/** + * CollectorManager for the TotalHitCountCollector + * + * @opensearch.internal + */ public class TotalHitCountCollectorManager implements CollectorManager,