|
19 | 19 | import org.elasticsearch.index.mapper.KeywordFieldMapper; |
20 | 20 | import org.elasticsearch.index.mapper.MappedFieldType; |
21 | 21 | import org.elasticsearch.index.mapper.TextFieldMapper; |
| 22 | +import org.elasticsearch.index.query.ParsedQuery; |
| 23 | +import org.elasticsearch.search.builder.SearchSourceBuilder; |
22 | 24 | import org.elasticsearch.search.fetch.FetchContext; |
23 | 25 | import org.elasticsearch.search.fetch.FetchSubPhase; |
24 | 26 | import org.elasticsearch.search.fetch.FetchSubPhaseProcessor; |
@@ -146,25 +148,6 @@ private FieldContext contextBuilders( |
146 | 148 | sourceRequired = true; |
147 | 149 | } |
148 | 150 |
|
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; |
168 | 151 | Query highlightQuery = getHighlighterQuery(context, field, fieldType); |
169 | 152 |
|
170 | 153 | builders.put( |
|
0 commit comments