Skip to content

same field names may raise confliction with different type and analyzer #14575

Closed
@hawkwang

Description

@hawkwang

Here is the statement about how this happens, see as follows:

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"}
}
}
}

}'

The following error messages occurs:

{
"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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions