修复es索引中存在多个mapping时无法解析的问题
This commit is contained in:
parent
1e988c58e0
commit
17ce3d2ecd
|
|
@ -164,9 +164,13 @@ public abstract class AbstractElasticSearchIndexStrategy implements ElasticSearc
|
|||
throw new UnsupportedOperationException("unsupported index metadata" + metaData);
|
||||
}
|
||||
properties = mappingMetadata.sourceAsMap();
|
||||
}
|
||||
if (metaData.size() == 1) {
|
||||
Object res = metaData.values().iterator().next().value;
|
||||
} else {
|
||||
Object res;
|
||||
if (metaData.size() == 1) {
|
||||
res = metaData.values().iterator().next().value;
|
||||
} else {
|
||||
res = metaData.get("_doc");
|
||||
}
|
||||
if (res instanceof MappingMetadata) {
|
||||
mappingMetadata = ((MappingMetadata) res);
|
||||
} else if (res instanceof CompressedXContent) {
|
||||
|
|
@ -179,6 +183,7 @@ public abstract class AbstractElasticSearchIndexStrategy implements ElasticSearc
|
|||
if (properties == null) {
|
||||
throw new UnsupportedOperationException("unsupported index metadata" + metaData);
|
||||
}
|
||||
|
||||
return new DefaultElasticSearchIndexMetadata(index, convertProperties(properties));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue