-
Notifications
You must be signed in to change notification settings - Fork 25.8k
Description
Description
The ContextIndexSearcher has some API to deal with cancelled tasks, see for example hasCancellations() below. Acting on cancelled tasks can be useful in ValueFetchers (which can be implemented by plugins via custom runtime fields), where resources can be released in such a case.
Although the method hasCancellations() is public and accessible to plugins, there is however no access point to its counterpart checkCancelled() (see below): that method would be needed to check if the search's task got cancelled (and act upon it).
- Would it be possible to add a public access method to
checkCancelled(), in order to allow plugins to handle cancellations in custom runtime fields ? - Related question: are
IndexSearchers used in Elasticsearch allContextIndexSearcherinstances ?
elasticsearch/server/src/main/java/org/elasticsearch/search/internal/ContextIndexSearcher.java
Line 193 in 0d2db06
| public boolean hasCancellations() { |
elasticsearch/server/src/main/java/org/elasticsearch/index/mapper/MappedFieldType.java
Line 118 in 0d2db06
| public abstract ValueFetcher valueFetcher(SearchExecutionContext context, @Nullable String format); |
elasticsearch/server/src/main/java/org/elasticsearch/search/internal/ContextIndexSearcher.java
Line 594 in 0d2db06
| public void checkCancelled() { |