java.io.Closeable, java.lang.AutoCloseable, LifecycleComponent, Releasable, IndexEventListenerpublic class SearchService extends AbstractLifecycleComponent implements IndexEventListener
| Modifier and Type | Field | Description |
|---|---|---|
static Setting<java.lang.Boolean> |
DEFAULT_ALLOW_PARTIAL_SEARCH_RESULTS |
|
static Setting<TimeValue> |
DEFAULT_KEEPALIVE_SETTING |
|
static Setting<TimeValue> |
DEFAULT_SEARCH_TIMEOUT_SETTING |
|
static Setting<TimeValue> |
KEEPALIVE_INTERVAL_SETTING |
|
static Setting<java.lang.Boolean> |
LOW_LEVEL_CANCELLATION_SETTING |
Enables low-level, frequent search cancellation checks.
|
static Setting<TimeValue> |
MAX_KEEPALIVE_SETTING |
|
static TimeValue |
NO_TIMEOUT |
deprecationLogger, logger, settingslifecycle| Constructor | Description |
|---|---|
SearchService(ClusterService clusterService,
IndicesService indicesService,
ThreadPool threadPool,
ScriptService scriptService,
BigArrays bigArrays,
FetchPhase fetchPhase,
ResponseCollectorService responseCollectorService) |
logDeprecatedSetting, logRemovedSetting, nodeNameaddLifecycleListener, close, lifecycleState, removeLifecycleListener, start, stopafterIndexCreated, afterIndexShardClosed, afterIndexShardCreated, afterIndexShardDeleted, afterIndexShardStarted, beforeIndexAddedToCluster, beforeIndexCreated, beforeIndexRemoved, beforeIndexShardClosed, beforeIndexShardCreated, beforeIndexShardDeleted, indexShardStateChanged, onShardInactive, onStoreClosed, shardRoutingChangedpublic static final Setting<java.lang.Boolean> LOW_LEVEL_CANCELLATION_SETTING
public static final TimeValue NO_TIMEOUT
public static final Setting<TimeValue> DEFAULT_SEARCH_TIMEOUT_SETTING
public static final Setting<java.lang.Boolean> DEFAULT_ALLOW_PARTIAL_SEARCH_RESULTS
public SearchService(ClusterService clusterService, IndicesService indicesService, ThreadPool threadPool, ScriptService scriptService, BigArrays bigArrays, FetchPhase fetchPhase, ResponseCollectorService responseCollectorService)
public boolean defaultAllowPartialSearchResults()
public void afterIndexRemoved(Index index, IndexSettings indexSettings, IndicesClusterStateService.AllocatedIndices.IndexRemovalReason reason)
IndexEventListenerafterIndexRemoved in interface IndexEventListenerindex - The indexreason - the reason for index removalprotected void putContext(SearchContext context)
protected SearchContext removeContext(long id)
protected void doStart()
doStart in class AbstractLifecycleComponentprotected void doStop()
doStop in class AbstractLifecycleComponentprotected void doClose()
doClose in class AbstractLifecycleComponentpublic void executeDfsPhase(ShardSearchRequest request, SearchTask task, ActionListener<SearchPhaseResult> listener)
public void executeQueryPhase(ShardSearchRequest request, SearchTask task, ActionListener<SearchPhaseResult> listener)
public ScrollQuerySearchResult executeQueryPhase(InternalScrollSearchRequest request, SearchTask task)
public QuerySearchResult executeQueryPhase(QuerySearchRequest request, SearchTask task)
public ScrollQueryFetchSearchResult executeFetchPhase(InternalScrollSearchRequest request, SearchTask task)
public FetchSearchResult executeFetchPhase(ShardFetchRequest request, SearchTask task)
public org.elasticsearch.search.DefaultSearchContext createSearchContext(ShardSearchRequest request, TimeValue timeout) throws java.io.IOException
java.io.IOExceptionpublic boolean freeContext(long id)
public void freeAllScrollContexts()
public int getActiveContexts()
public ResponseCollectorService getResponseCollectorService()
public AliasFilter buildAliasFilter(ClusterState state, java.lang.String index, java.lang.String... expressions)
public boolean canMatch(ShardSearchRequest request) throws java.io.IOException
false the query won't match any documents on the current
shard.java.io.IOExceptionpublic static boolean canRewriteToMatchNone(SearchSourceBuilder source)
public QueryRewriteContext getRewriteContext(java.util.function.LongSupplier nowInMillis)
QueryRewriteContext with the given now providerpublic InternalAggregation.ReduceContext createReduceContext(boolean finalReduce)