Mapper Parsing Exception: Root mapping definition has unsupported paramenters

Hello,

I am having trouble using the Mapper attachment with ES. I am trying to use the mapper attachment to create a mapping corresponding to the MongoDB collection where my GridFS files are. I am using the mongo-connector to connect ES and Mongodb.
My problem is that I am trying trying to use the Gridfs support through following this small tutorial:https://github.com/mongodb-labs/mongo-connector/wiki/Usage%20with%20ElasticSearch

This is the mapping that I am trying to create:

curl -XPUT --noproxy '*' http://localhost:9201/project_fs/collection.fs/_mapping -d ' {
"fs": {
"properties": {
"content_type": {"type": "attachment"}
}}}'

This is the error that it is creating:

{"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"Root mapping definition has unsupported parameters: [fs : {properties={content_type {type=attachment}}}]"}],"type":"mapper_parsing_exception","reason":"Root mapping definition has unsupported parameters: [fs : {properties={content_type={type=attachment}}}]"},"status":400}

I am using ES 2.1.2 and the mapper-attachment (3.1.2) plugin is installed .

Thanks,
AJ

Please format your code using </> icon. It will make your post more readable.

I did not check in details but here is a first thought:

You are sending a mapping to http://localhost:9201/project_fs/collection.fs/_mapping which means:

  • index: project_fs
  • type: collection.fs

The mapping you sent refers to:

{
"fs": {
  "properties": {
     "content_type": {"type": "attachment"}
}}}

type is fs

So it's not consistent.

Finally, read this doc: https://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-put-mapping.html