public class SearchService extends AbstractLifecycleComponent implements IndexEventListener
| Modifier and Type | Field and Description |
|---|---|
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 TimeValue |
NO_TIMEOUT |
lifecycledeprecationLogger, logger, settings| Constructor and Description |
|---|
SearchService(ClusterService clusterService,
IndicesService indicesService,
ThreadPool threadPool,
ScriptService scriptService,
BigArrays bigArrays,
FetchPhase fetchPhase) |
| Modifier and Type | Method and Description |
|---|---|
void |
afterIndexRemoved(Index index,
IndexSettings indexSettings,
IndicesClusterStateService.AllocatedIndices.IndexRemovalReason reason)
Called after the index has been removed.
|
AliasFilter |
buildAliasFilter(ClusterState state,
java.lang.String index,
java.lang.String... expressions) |
boolean |
canMatch(ShardSearchRequest request)
This method does a very quick rewrite of the query and returns true if the query can potentially match any documents.
|
static boolean |
canRewriteToMatchNone(SearchSourceBuilder source)
Returns true iff the given search source builder can be early terminated by rewriting to a match none query.
|
org.elasticsearch.search.DefaultSearchContext |
createSearchContext(ShardSearchRequest request,
TimeValue timeout,
Engine.Searcher searcher) |
protected void |
doClose() |
protected void |
doStart() |
protected void |
doStop() |
DfsSearchResult |
executeDfsPhase(ShardSearchRequest request,
SearchTask task) |
ScrollQueryFetchSearchResult |
executeFetchPhase(InternalScrollSearchRequest request,
SearchTask task) |
FetchSearchResult |
executeFetchPhase(ShardFetchRequest request,
SearchTask task) |
ScrollQuerySearchResult |
executeQueryPhase(InternalScrollSearchRequest request,
SearchTask task) |
QuerySearchResult |
executeQueryPhase(QuerySearchRequest request,
SearchTask task) |
SearchPhaseResult |
executeQueryPhase(ShardSearchRequest request,
SearchTask task) |
void |
freeAllScrollContexts() |
boolean |
freeContext(long id) |
int |
getActiveContexts()
Returns the number of active contexts in this
SearchService
|
protected void |
putContext(SearchContext context) |
protected SearchContext |
removeContext(long id) |
addLifecycleListener, close, lifecycleState, removeLifecycleListener, start, stoplogDeprecatedSetting, logRemovedSetting, nodeNameclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitafterIndexCreated, 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 SearchService(ClusterService clusterService, IndicesService indicesService, ThreadPool threadPool, ScriptService scriptService, BigArrays bigArrays, FetchPhase fetchPhase)
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 DfsSearchResult executeDfsPhase(ShardSearchRequest request, SearchTask task) throws java.io.IOException
java.io.IOExceptionpublic SearchPhaseResult executeQueryPhase(ShardSearchRequest request, SearchTask task) throws java.io.IOException
java.io.IOExceptionpublic 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, @Nullable Engine.Searcher searcher) throws java.io.IOException
java.io.IOExceptionpublic boolean freeContext(long id)
public void freeAllScrollContexts()
public int getActiveContexts()
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)