|
@@ -56,7 +56,7 @@ import org.elasticsearch.index.IndexSortConfig;
|
|
import org.elasticsearch.index.mapper.DateFieldMapper.DateFieldType;
|
|
import org.elasticsearch.index.mapper.DateFieldMapper.DateFieldType;
|
|
import org.elasticsearch.index.mapper.MappedFieldType;
|
|
import org.elasticsearch.index.mapper.MappedFieldType;
|
|
import org.elasticsearch.search.DocValueFormat;
|
|
import org.elasticsearch.search.DocValueFormat;
|
|
-import org.elasticsearch.search.SearchPhase;
|
|
|
|
|
|
+import org.elasticsearch.search.SearchContextSourcePrinter;
|
|
import org.elasticsearch.search.SearchService;
|
|
import org.elasticsearch.search.SearchService;
|
|
import org.elasticsearch.search.aggregations.AggregationPhase;
|
|
import org.elasticsearch.search.aggregations.AggregationPhase;
|
|
import org.elasticsearch.search.internal.ContextIndexSearcher;
|
|
import org.elasticsearch.search.internal.ContextIndexSearcher;
|
|
@@ -92,7 +92,7 @@ import static org.elasticsearch.search.query.TopDocsCollectorContext.shortcutTot
|
|
* Query phase of a search request, used to run the query and get back from each shard information about the matching documents
|
|
* 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
|
|
* (document ids and score or sort criteria) so that matches can be reduced on the coordinating node
|
|
*/
|
|
*/
|
|
-public class QueryPhase implements SearchPhase {
|
|
|
|
|
|
+public class QueryPhase {
|
|
private static final Logger LOGGER = LogManager.getLogger(QueryPhase.class);
|
|
private static final Logger LOGGER = LogManager.getLogger(QueryPhase.class);
|
|
// TODO: remove this property in 8.0
|
|
// TODO: remove this property in 8.0
|
|
public static final boolean SYS_PROP_REWRITE_SORT = Booleans.parseBoolean(System.getProperty("es.search.rewrite_sort", "true"));
|
|
public static final boolean SYS_PROP_REWRITE_SORT = Booleans.parseBoolean(System.getProperty("es.search.rewrite_sort", "true"));
|
|
@@ -107,7 +107,6 @@ public class QueryPhase implements SearchPhase {
|
|
this.rescorePhase = new RescorePhase();
|
|
this.rescorePhase = new RescorePhase();
|
|
}
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
|
public void preProcess(SearchContext context) {
|
|
public void preProcess(SearchContext context) {
|
|
final Runnable cancellation;
|
|
final Runnable cancellation;
|
|
if (context.lowLevelCancellation()) {
|
|
if (context.lowLevelCancellation()) {
|
|
@@ -129,7 +128,6 @@ public class QueryPhase implements SearchPhase {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
|
public void execute(SearchContext searchContext) throws QueryPhaseExecutionException {
|
|
public void execute(SearchContext searchContext) throws QueryPhaseExecutionException {
|
|
if (searchContext.hasOnlySuggest()) {
|
|
if (searchContext.hasOnlySuggest()) {
|
|
suggestPhase.execute(searchContext);
|
|
suggestPhase.execute(searchContext);
|