From 7ab128bbba7bb11248a93816a2a9b3f59a4a2e83 Mon Sep 17 00:00:00 2001 From: Shay Banon Date: Thu, 22 Sep 2011 16:02:18 +0300 Subject: [PATCH] Put mapping on a single node with new mapping will not wait for the mapping to be applied, closes #1355. --- .../cluster/metadata/MetaDataMappingService.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/cluster/metadata/MetaDataMappingService.java b/modules/elasticsearch/src/main/java/org/elasticsearch/cluster/metadata/MetaDataMappingService.java index af79baf7514..f7b8d7932f8 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/cluster/metadata/MetaDataMappingService.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/cluster/metadata/MetaDataMappingService.java @@ -313,6 +313,10 @@ public class MetaDataMappingService extends AbstractComponent { } else { CompressedString newSource = newMapper.mappingSource(); mappings.put(index, new MappingMetaData(newMapper)); + // we also add it to the registered parsed mapping, since that's what we do when we merge + // and, we won't wait for it to be created on this master node + IndexService indexService = indicesService.indexService(index); + indexService.mapperService().add(newMapper.type(), newMapper.mappingSource().string()); if (logger.isDebugEnabled()) { logger.debug("[{}] create_mapping [{}] with source [{}]", index, newMapper.type(), newSource); } else if (logger.isInfoEnabled()) {