Stuck doctype in elasticsearch 6.2.3

Hello. I'm having some problems with the doc_type in elasticsearch.

The doctype in my index used to be "doc" like it's supposed to be by default, but it got changed to something else. This leads to errors when trying to insert stuff into the index ("type"=>"illegal_argument_exception", "reason"=>"Rejecting mapping update to [exampleindexnamehere] as the final mapping would have more than 1 type: [doc, crash])

My problem is that i CANNOT seem to be able to reset the doctype back to its default value. If I remove the "contaminated" index, elasticsearch still automatically uses the wrong default type when it recreates the index automatically. I've tried using the API to put a fixed index mapping in, but that causes the same error, cannot replace, because the index would then have two types... i did not copy that error but it's pretty similar to the one above.

I read that in the past deleting index mappings was possible, but not anymore (https://www.elastic.co/guide/en/elasticsearch/reference/6.2/indices-delete-mapping.html). And like I said, recreating the index causes the wrong type to be used automagically. Very frustrating.

Now, i could change the index name to something totally different. I tried that and it worked, no more wrong doctype, but that's something i can't do. I must have the index named as it used to be.

Data is free and i can blow everything up, like if there's a way to wipe everything from elasticsearch to fix this, I could totally do it. But I MUST be able to use the original index name. I've been trying to solve this problem for this whole day and am pretty much ready to just purge elasticsearch from my system and do a full reinstall, but surely there is a better way to solve this? After all, it's just one type definition.

-Upkeihas

For clarity, here's the beginning of the broken doc type mapping:
{
"insertindexnamehere": {
"aliases": {},
"mappings": {
"crash": {
"include_in all...

and it should be
{
"insertindexnamehere": {
"aliases": {},
"mappings": {
"doc": {
"include_in all...

so... how? Thanks for your time :slight_smile:

May be you have an index template?

I'm gonna try to find out, thanks for the tip

Okey, the problem indeed was that there was an existing pattern already added which caused the unexpected behaviour. Thanks for the tip :slight_smile:

-Upkeihas

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