# Mapping definition for fields has unsupported parameters

**URL:** <https://discuss.elastic.co/t/mapping-definition-for-fields-has-unsupported-parameters/43610>\
**Category:** Elasticsearch\
**Created:** [March 7, 2016, 1:53am UTC](https://discuss.elastic.co/t/mapping-definition-for-fields-has-unsupported-parameters/43610 "2016-03-07T01:53:27Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hieu\_Dang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hieu_dang/32/8208_2.png) [@Hieu\_Dang](https://discuss.elastic.co/u/Hieu_Dang)\
**Post date:** [March 7, 2016, 1:53am UTC](https://discuss.elastic.co/t/mapping-definition-for-fields-has-unsupported-parameters/43610/1 "2016-03-07T01:53:27Z")

</div>

I am using OSX El capitan, ES 2.1. When I reindex It throw these errors:

`Elasticsearch::Transport::Transport::Errors::BadRequest: [400] {"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"Mapping definition for [fields] has unsupported parameters: [file : {type=string}]"}],"type":"mapper_parsing_exception","reason":"Failed to parse mapping [attachment]: Mapping definition for [fields] has unsupported parameters: [file : {type=string}]","caused_by":{"type":"mapper_parsing_exception","reason":"Mapping definition for [fields] has unsupported parameters: [file : {type=string}]"}},"status":400}`

what is the problem and how to fix? thanks a lot

When I start ES it also threw error

`[2016-03-07 08:51:26,982][WARN][index.translog] [Scarlet Beetle] [versions][4] failed to delete temp file /usr/local/var/elasticsearch/elasticsearch_capuchino/nodes/0/indices/versions/4/translog/translog-8945599092104577137.tlog java.nio.file.NoSuchFileException: /usr/local/var/elasticsearch/elasticsearch_capuchino/nodes/0/indices/versions/4/translog/translog-8945599092104577137.tlog`

I searched and it seem to error in ES 2.1? how to upgrade to 2.2 in mac or have another way to fix?

thanks a lot (bow)

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [March 7, 2016, 2:05am UTC](https://discuss.elastic.co/t/mapping-definition-for-fields-has-unsupported-parameters/43610/2 "2016-03-07T02:05:21Z")

</div>

> [@Hieu\_Dang](#):
>
> Mapping definition for [fields] has unsupported parameters: [file : {type=string}]

That's the problem. What does the mapping look like.

---

<div class="post-metadata">

**Author:** ![Hieu\_Dang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hieu_dang/32/8208_2.png) [@Hieu\_Dang](https://discuss.elastic.co/u/Hieu_Dang)\
**Post date:** [March 7, 2016, 2:37am UTC](https://discuss.elastic.co/t/mapping-definition-for-fields-has-unsupported-parameters/43610/3 "2016-03-07T02:37:02Z")

</div>

oh I tried comment out  
`field :file, type: "string", analyzer...` it worked

then how to fix that mapping?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [March 7, 2016, 2:38am UTC](https://discuss.elastic.co/t/mapping-definition-for-fields-has-unsupported-parameters/43610/4 "2016-03-07T02:38:41Z")

</div>

> [@warkolm](#):
>
> What does the mapping look like.

Showing us this would help.

---

<div class="post-metadata">

**Author:** ![Hieu\_Dang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hieu_dang/32/8208_2.png) [@Hieu\_Dang](https://discuss.elastic.co/u/Hieu_Dang)\
**Post date:** [March 7, 2016, 2:46am UTC](https://discuss.elastic.co/t/mapping-definition-for-fields-has-unsupported-parameters/43610/5 "2016-03-07T02:46:00Z")

</div>

```auto
settings analysis: {
      tokenizer: {
        custom_tokenizer: {
          type: "nGram",
          token_chars: %w(letter digit whitespace punctuation symbol)
        }
      },
      analyzer: {
        custom_analyzer: {
          type: "custom",
          tokenizer: "custom_tokenizer",
          filter: "lowercase"
        }
      }
    }

```

```auto
define_type Attachment.active.for_candidates do
    root parent: {type: "candidate"}, parent_id: ->{attachable_id}
    field :file_name, analyzer: "custom_analyzer"
    field :file, type: "attachment", value: ->attachment do
      if attachment.file.present?
        Base64.encode64 open(attachment.file.path){|file| file.read}
      else
        ""
      end
    end do
      field :file, type: "string", analyzer: "custom_analyzer"
    end
  end

```

here u are 🙂

---

<div class="post-metadata">

**Author:** ![Hieu\_Dang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hieu_dang/32/8208_2.png) [@Hieu\_Dang](https://discuss.elastic.co/u/Hieu_Dang)\
**Post date:** [March 7, 2016, 6:42am UTC](https://discuss.elastic.co/t/mapping-definition-for-fields-has-unsupported-parameters/43610/6 "2016-03-07T06:42:36Z")

</div>

thanks, I can fixed this  
my mistake to not run `rake db:migrate` ☹

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2017, 11:10pm UTC](https://discuss.elastic.co/t/mapping-definition-for-fields-has-unsupported-parameters/43610/7 "2017-07-05T23:10:52Z")

</div>


