Inconsistent field mapping -- sometimes string, sometimes long


(Khadrin) #1

The following api request sometimes returns that date is a string, other times it's a long.
It looks to be about 50/50 but random whether it returns string or long. I expected it would always return the same. What am I missing?

We are on Elasticsearch 1.1.2 if that matters.

Thanks,
Stephen

$ for ((i=0;i<2;++i)) do curl -s 'http://localhost:9200/logstash-2016.01.11/_mapping/logs/field/date?pretty=true'; done                                                                                                                                               
{
  "logstash-2016.01.11" : {
    "mappings" : {
      "logs" : {
        "date" : {
          "full_name" : "date", "mapping" : {"date":{"type":"string","norms":{"enabled":false},"fields":{"raw":{"type":"string","index":"not_analyzed","ignore_above":256}}}}
        }
      }
    }
  }
}
{
  "logstash-2016.01.11" : {
    "mappings" : {
      "logs" : {
        "date" : {
          "full_name" : "date", "mapping" : {"date":{"type":"long"}}
        }
      }
    }
  }
}

Inconsistency between primary shard and replicas around _source
(Mark Walkom) #2

Ouch, do you have more than one node in your cluster? It could be that the cluster state is out of sync between them.

Time to upgrade!


(Colin Goodheart-Smithe) #3

I think you might be hitting the issue described in this post . This is a bug that was fixed in 2.0 so you will need to upgrade to avoid hitting it again or explicitly map the fields in your index and not rely on the dynamic mapping


(Khadrin) #4

Thanks guys. Does look like it might be the issue mentioned that was fixed in 2.0. We are working on upgrading, so hopefully that fixes it!


(system) #5