double check that there are mappings before trying to call the post process method

This commit is contained in:
kimchy 2011-04-19 16:10:51 +03:00
parent 32127c4d73
commit 79ebcc31c5
1 changed files with 5 additions and 3 deletions

View File

@ -521,12 +521,14 @@ public class XContentDocumentMapper implements DocumentMapper, ToXContent {
@Override public void processDocumentAfterIndex(Document doc) {
for (Fieldable field : doc.getFields()) {
FieldMappers fieldMappers = mappers().indexName(field.name());
if (fieldMappers != null) {
FieldMapper mapper = fieldMappers.mapper();
if (mapper != null) {
mapper.processFieldAfterIndex(field);
}
}
}
}
@Override public synchronized MergeResult merge(DocumentMapper mergeWith, MergeFlags mergeFlags) {
XContentDocumentMapper xContentMergeWith = (XContentDocumentMapper) mergeWith;