Rejecting mapping update to [test-index] as the final mapping would have more than 1 type: [_doc, products]

Hi, I'm working on migrating my elasticsearch 2.4 to the latest version 7.5.

Due to removal of mapping types in the elasticsearch 6.0, I was earlier using multiple types in a single index.

Now, I've defined my mappings like this:

"test-index: {
    "mappings": {
        "properties": {
            // custom type field - category
           "category": {
               "properties": {
                      // definitions
                } 
           },
           "products": {
                "properties": {
                     // definitions
                 }
            },
        }
    }
}

So, in this way in a single index, I'm trying to store multiple types. This does not give me any error and output is a success.

But, when I try to populate the data in the index during bulk indexing, it throws this error:

Rejecting mapping update to [test-index] as the final mapping would have more than 1 type: [_doc, category]

Rejecting mapping update to [test-index] as the final mapping would have more than 1 type: [_doc, products]

Why is this happening? It would be great if anyone can help me fix this out.

the mapping itself looks fine, however without the URLs specified that you call, it is impossible to tell if that requests is valid.

What basically happens is, that _doc is the default type, but somewhere in your mapping update calls or index templates, there is a reference to the category or products type.

If this should be debugged further, a minimal working example includes all URLs, request bodies, index creation calls, index templates up to that error message is needed.

Hi Alexander, I debugged my program and found that mapping was correct but the method which I was using for bulk indexing was having an another method Type, which is already deprecated in the latest version of ES. I've removed it, and it seems to work perfect now.

Thank you for the help, I really appreciate it. :slight_smile:

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.