Migration checker showed conflict

Hi,
I ran migration checker to see if I can move from ES 1.7.1 to 2.0 and got many mapping conflicts, one of them is that I have within same index 2 different types each one of them has same field : account and it's mapping is (both fields has exactly same mapping):

type : string
index : not_analyzed
store : no
doc_values : true

Here the exact mapping (Java) :
Type A:

....
.startObject("account") 
	.field("type", "string") 
	.field("index", "not_analyzed") 
	.field("store", "no") 
	.field("doc_values","true")
.endObject() 
....

Type B:

....
.startObject("account") 
	.field("type", "string") 
	.field("index", "not_analyzed") 
	.field("store", "no") 
	.field("doc_values","true")
.endObject()
....

They exactly the same, so, I don't see any conflict between two of them, but maybe I'm missing something.
Any advise ?

Thanks

Can you post the error you got from the migration checker. I'd also look at GET /indexname/_mapping.

Hi,
Sure this is the error output (partial) :

Checks completed. The cluster requires action before upgrading.
Elasticsearch version: 1.7.1
Index: myindex
Conflicting field mappings
Mapping for field typeb:account conflicts with: typed:account. Check parameters: doc_values, store
Mapping for field typeb:account conflicts with: typea:account. Check parameters: doc_values, store
Mapping for field typeb:account conflicts with: typee:account. Check parameters: doc_values, store
Mapping for field typeb:account conflicts with: typec:account. Check parameters: doc_values, store
Mapping for field typeb:title conflicts with: typea:title. Check parameter: index
Mapping for field typeb:user conflicts with: typed:user. Check parameters: doc_values, store
Mapping for field typeb:user conflicts with: typea:user. Check parameters: doc_values, store
Mapping for field typeb:user conflicts with: typee:user. Check parameters: doc_values, store
Mapping for field typeb:user conflicts with: typec:user. Check parameters: doc_values, store
....

And this is the mapping that gives the error (doc_values properties are not returned by GET /indexname/_mapping, but fields account and user are defined with doc_values true) :

{
  "myindex" : {
    "mappings" : {
      "typea" : {
        "_source" : {
          "enabled" : false
        },
        "properties" : {
          "account" : {
            "type" : "string",
            "index" : "not_analyzed",
            "store" : true
          },
          "title" : {
            "type" : "string",
            "store" : true
          },
          "user" : {
            "type" : "string",
            "index" : "not_analyzed",
            "store" : true
          }
        }
      },
      "typeb" : {
        "_source" : {
          "enabled" : false
        },
        "properties" : {
          "account" : {
            "type" : "string",
            "index" : "not_analyzed",
            "doc_values" : true
          },
          "title" : {
            "type" : "string",
            "index" : "no",
            "store" : true
          },
          "user" : {
            "type" : "string",
            "index" : "not_analyzed",
            "doc_values" : true
          }
        }
      },
      "typec" : {
        "_source" : {
          "enabled" : false
        },
        "properties" : {
          "account" : {
            "type" : "string",
            "index" : "not_analyzed",
            "store" : true
          },
          "user" : {
            "type" : "string",
            "index" : "not_analyzed",
            "store" : true
          }
        }
      },
      "typed" : {
        "_source" : {
          "enabled" : false
        },
        "properties" : {
          "account" : {
            "type" : "string",
            "index" : "not_analyzed",
            "store" : true
          },
          "user" : {
            "type" : "string",
            "index" : "not_analyzed",
            "store" : true
          }
        }
      },
      "typee" : {
        "_source" : {
          "enabled" : false
        },
        "properties" : {
          "account" : {
            "type" : "string",
            "index" : "not_analyzed",
            "store" : true
          },
          "user" : {
            "type" : "string",
            "index" : "not_analyzed",
            "store" : true
          }
        }
      }
    }
  }
}

Thanks

Hi,

The issue is that you have multiple types and typeb.account has doc_values true where the other types don't. So this is a mapping conflict and needs to be resolved before upgrading. So you'll need to create a new mapping and re-index your data.

Hi,
Seems that you're right, but interesting that java code for mapping is the same (copy & paste :smile:) :

.startObject(IndexFields.ACNT.getIndexName()) 
	.field("type", "string") 
	.field("index", "not_analyzed") 
	.field("store", "no")
	.field("doc_values","true")
.endObject() 

But only for typeb it has meapping with doc_values = true, other types are not (somehow).

Thanks, now I have to reindex :frowning: