Closed nhhagen closed 8 years ago
Indeed.
Here is a fix (almost a fix) for this:
curl -XDELETE http://localhost:9200/person?pretty
curl -XPUT http://localhost:9200/person/?pretty
curl -XPUT http://localhost:9200/person/person/_mapping?pretty -d '
{
"person" : {
"properties" : {
"file" : {
"type" : "attachment",
"fields" : {
"title" : {"store" : "yes"},
"date" : {"store" : "yes"},
"author" : {"analyzer" : "standard"},
"keywords" : {"store" : "yes"},
"content_type" : {"store" : "yes"},
"content_length" : {"store" : "yes"},
"language" : {"store" : "yes"}
}
}
}
}
}
'
But I can't define the file
inner field. When doing this I get:
{
"error" : {
"root_cause" : [ {
"type" : "mapper_parsing_exception",
"reason" : "Mapping definition for [fields] has unsupported parameters: [file : {}]"
} ],
"type" : "mapper_parsing_exception",
"reason" : "Mapping definition for [fields] has unsupported parameters: [file : {}]"
},
"status" : 400
}
So to me, there is a bug in documentation for 2.0 and an actual bug in code as well.
Got it now. This commit 765afb655ed4051371bf9177c13a5888405747bd changed the behavior. So the file content in now in content
field.
It's only a documentation issue.
Request
Response