Skip to content

Reindexing with changes in the structure of the document is not possible #2444

Open
@jmartinm

Description

@jmartinm

The issue might be better tackled in https://github.com/inspirehep/es-cli

If e.g. the current mapping contains:

"persistent_identifiers": {
    "type": "string"
}

And the new mapping contains:

"persistent_identifiers": {
    "properties": {
        "schema": {
             "type": "string"
        },
        "value": {
            "type": "string"
        }
     }
},

Using the ES reindex API will throw an error:

{u'reason': u'object mapping for [references.reference.persistent_identifiers] tried to parse field [null] as object, but found a concrete value', u'type': u'mapper_parsing_exception'}, u'_index': u'remapping_tmp_records-hep'}}])

Expected Behavior

A transformation should happen on reindex time so that the destination field gets properly populated.

One option could be to use the script functionality - see https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-reindex.html

Current Behavior

An error occurs, so we don't have a mechanism for reindexing. Records need to be recreated from scratch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions