curl -XPUT 'localhost:9200/company?pretty' -d '
{
"mappings": {
"basic": {
"properties": {
"id" : {"type" : "string", "index" : "not_analyzed"},
"title" : {
"type" : "string",
"fields": {
"raw": {
"type": "string",
"index": "not_analyzed"
}
}
},
"djjg" : {"type" : "string", "index" : "not_analyzed"}
}
},
"investor": {
"_parent": {
"type": "basic"
},
"properties": {
"title" : {"type" : "string", "index" : "not_analyzed"},
"type" : {"type" : "string", "index" : "not_analyzed"}
}
}
}
{
"error" : {
"root_cause" : [ {
"type" : "mapper_parsing_exception",
"reason" : "mapping [investor]"
} ],
"type" : "mapper_parsing_exception",
"reason" : "mapping [investor]",
"caused_by" : {
"type" : "illegal_argument_exception",
"reason" : "Mapper for [title] conflicts with existing mapping in other types:\n[mapper [title] has different [index] values, mapper [title] has different [doc_values] values, cannot change from disabled to enabled, mapper [title] has different [analyzer], mapper [title] is used by multiple types. Set update_all_types to true to update [omit_norms] across all types., mapper [title] is used by multiple types. Set update_all_types to true to update [search_analyzer] across all types., mapper [title] is used by multiple types. Set update_all_types to true to update [search_quote_analyzer] across all types.]"
}
},
"status" : 400
I guess this error is raised due to same "title" fields used in parent and child mode :-)
Of cause, I can change the second one to "name", and that is fine.
But I think it should be not a big problem.
Any hint???
Regards,
Hawk
I guess this error is raised due to same "title" fields used in parent and child mode :-)
Of cause, I can change the second one to "name", and that is fine.
yes that's the reason, even though they seem to be isolated they are not. You have to either specify the same analyzer and type or use a different name.
Is there a blog post or some article explaining this? I'm trying to upgrade from ES1.7.1 to ES2.0.0 and I'm getting this error, and I don't understand what Set update_all_types to true
means. Where do I set update_all_types
?
Would removing and reindexing all of the data fix this for me? Or is the problem with the mappings?
2015-11-08 19:22:34 Commons Daemon procrun stderr initialized
Exception in thread "main" tion: unable to upgrade the mappings for the index [test1], reason: [Mapper for [_all] conflicts with existing mapping in other types:
[mapper [_all] has different [analyzer], mapper [_all] is used by multiple types. Set update_all_types to true to update [search_analyzer] across all types., mapper [_all] is used by multiple types. Set update_all_types to true to update [search_quote_analyzer] across all types.]]
Likely root cause: java.lang.IllegalArgumentException: Mapper for [_all] conflicts with existing mapping in other types:
[mapper [_all] has different [analyzer], mapper [_all] is used by multiple types. Set update_all_types to true to update [search_analyzer] across all types., mapper [_all] is used by multiple types. Set update_all_types to true to update [search_quote_analyzer] across all types.]
at org.elasticsearch.index.mapper.FieldTypeLookup.checkCompatibility(FieldTypeLookup.java:117)
at org.elasticsearch.index.mapper.MapperService.checkNewMappersCompatibility(MapperService.java:345)
at org.elasticsearch.index.mapper.MapperService.merge(MapperService.java:296)
at org.elasticsearch.index.mapper.MapperService.merge(MapperService.java:242)
at org.elasticsearch.cluster.metadata.MetaDataIndexUpgradeService.checkMappingsCompatibility(MetaDataIndexUpgradeService.java:329)
at org.elasticsearch.cluster.metadata.MetaDataIndexUpgradeService.upgradeIndexMetaData(MetaDataIndexUpgradeService.java:112)
at org.elasticsearch.gateway.GatewayMetaState.pre20Upgrade(GatewayMetaState.java:226)
at org.elasticsearch.gateway.GatewayMetaState.<init>(GatewayMetaState.java:85)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at <<<guice>>>
at org.elasticsearch.node.Node.<init>(Node.java:198)
at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:145)
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:170)
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:270)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35)
Yeah during upgrade you can't specify that option (see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-put-mapping.html#merging-conflicts for where you can use it).
Essentially you need to fix or delete this index before upgrading. The migration plugin will help you to spot problematic indices before upgrading.
Please somebody explain why is this an expected behavior? To me it seems that its a non correct one. To my understanding there should be no connection between fields in different type
Please ask your question on discuss.elastic.co where we can certainly help.
Most helpful comment
Please somebody explain why is this an expected behavior? To me it seems that its a non correct one. To my understanding there should be no connection between fields in different type