Don't fail search if highlight field is missing for a specific type. Close #682

This commit is contained in:
Alberto Paro 2011-02-10 14:07:08 +01:00 committed by kimchy
parent a3af51a1d9
commit 5ea58a3387
1 changed files with 2 additions and 1 deletions

View File

@ -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