Don't fail search if highlight field is missing for a specific type. Close #682
This commit is contained in:
parent
a3af51a1d9
commit
5ea58a3387
|
@ -72,7 +72,8 @@ public class HighlightPhase implements SearchHitPhase {
|
|||
for (SearchContextHighlight.Field field : context.highlight().fields()) {
|
||||
FieldMapper mapper = documentMapper.mappers().smartNameFieldMapper(field.field());
|
||||
if (mapper == null) {
|
||||
throw new SearchException(context.shardTarget(), "No mapping found for [" + field.field() + "]");
|
||||
//Save skipping missing fields
|
||||
continue;
|
||||
}
|
||||
|
||||
// if we can do highlighting using Term Vectors, use FastVectorHighlighter, otherwise, use the
|
||||
|
|
Loading…
Reference in New Issue