Skip to content

Commit d1f428d

Browse files
committed
refactor
1 parent 2229e76 commit d1f428d

File tree

1 file changed

+2
-19
lines changed

1 file changed

+2
-19
lines changed

server/src/main/java/org/elasticsearch/search/fetch/subphase/highlight/HighlightPhase.java

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
import org.elasticsearch.index.mapper.KeywordFieldMapper;
2020
import org.elasticsearch.index.mapper.MappedFieldType;
2121
import org.elasticsearch.index.mapper.TextFieldMapper;
22+
import org.elasticsearch.index.query.ParsedQuery;
23+
import org.elasticsearch.search.builder.SearchSourceBuilder;
2224
import org.elasticsearch.search.fetch.FetchContext;
2325
import org.elasticsearch.search.fetch.FetchSubPhase;
2426
import org.elasticsearch.search.fetch.FetchSubPhaseProcessor;
@@ -146,25 +148,6 @@ private FieldContext contextBuilders(
146148
sourceRequired = true;
147149
}
148150

149-
// Query highlightQuery = field.fieldOptions().highlightQuery();
150-
// if (fieldType instanceof ConstantFieldType) {
151-
// if (context.query() instanceof MatchAllDocsQuery ){
152-
// highlightQuery = new TermQuery(new Term(fieldType.name(), getValueForConstantFieldType(context, fieldType)));
153-
// } else if (context.query() instanceof DisjunctionMaxQuery) {
154-
// DisjunctionMaxQuery disjunctionMaxQuery = (DisjunctionMaxQuery) context.query();
155-
// for (Query anyQuery : disjunctionMaxQuery.getDisjuncts()) {
156-
// if (anyQuery instanceof MatchAllDocsQuery){
157-
// highlightQuery = new TermQuery(new Term(fieldType.name(), getValueForConstantFieldType(context, fieldType)));
158-
// }
159-
// }
160-
// }
161-
// }
162-
//// if (((ConstantFieldType)fieldType).termQuery(getValueForConstantFieldType(context, fieldType),
163-
// context.getSearchExecutionContext()) instanceof MatchAllDocsQuery) {
164-
//// highlightQuery = new TermQuery(new Term(fieldType.name(), getValueForConstantFieldType(context, fieldType)));
165-
//// }
166-
//// }
167-
// Query finalHighlightQuery = highlightQuery;
168151
Query highlightQuery = getHighlighterQuery(context, field, fieldType);
169152

170153
builders.put(

0 commit comments

Comments
 (0)