Skip to content

Instantly share code, notes, and snippets.

Created September 26, 2013 17:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/c6a7c2063a4f696c79aa to your computer and use it in GitHub Desktop.
Save anonymous/c6a7c2063a4f696c79aa to your computer and use it in GitHub Desktop.
Problematic template mapping
curl -XPUT "http://localhost:9200/documents-2012-02-05/document/" -T ~/tmp/testdocument.json -d '
{
"file-path" : "2012/02/05/basketball/l.nba.com/standings/xt.15250060-nba-days.xml",
"file-creation-time" : "20120205T151456.000Z",
"date-time" : "20120205T151700.000Z"
}
'
{"error":"MapperParsingException[mapping [date]]; nested: MapperParsingException[Trying to parse an object but has a different type [date] for [date]]; ","status":400}
{
"template_document":{
"template":"documents-*",
"settings":{
"index.refresh_interval":"5s",
"number_of_shards":1,
"number_of_replicas":1,
"refresh_interval":"1s",
"index.query.default_field":"file-creation-time"
},
"mappings":{
"_default_":{
"date_detection" : 0,
"_all":{
"enabled":false
},
"_source":{
"enabled":false
}
},
"document":{
"properties":{
"_id":{
"type":"string",
"path":"file-path"
},
"file-path":{
"type":"string",
"store":true,
"index":"not_analyzed",
"null_value":"",
"include_in_all":true
},
"file-creation-time":{
"type":"date",
"format":"basic_date_time",
"store":true,
"include_in_all":true
},
"date-time":{
"type":"date",
"format":"basic_date_time",
"store":false,
"include_in_all":false
}
}
}
}
}
}
{
"file-path" : "2012/02/05/basketball/l.nba.com/standings/xt.15250060-nba-days.xml",
"file-creation-time" : "20120205T151456.000Z",
"date-time" : "20120205T151700.000Z"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment