# Error: "mapper\_parsing\_exception", "reason": "analyzer \[my\_custom\_analyzer\] not found for field \[topic\_content\]"

**URL:** <https://discuss.elastic.co/t/error-mapper-parsing-exception-reason-analyzer-my-custom-analyzer-not-found-for-field-topic-content/54543>\
**Category:** Elasticsearch\
**Created:** [July 1, 2016, 2:38pm UTC](https://discuss.elastic.co/t/error-mapper-parsing-exception-reason-analyzer-my-custom-analyzer-not-found-for-field-topic-content/54543 "2016-07-01T14:38:39Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![kausik93](https://avatars.discourse-cdn.com/v4/letter/k/e19b73/32.png) [@kausik93](https://discuss.elastic.co/u/kausik93)\
**Post date:** [July 1, 2016, 2:38pm UTC](https://discuss.elastic.co/t/error-mapper-parsing-exception-reason-analyzer-my-custom-analyzer-not-found-for-field-topic-content/54543/1 "2016-07-01T14:38:39Z")

</div>

Hi, I'm building an application that uses elasticsearch to store textual data from various csv inputs. i'm running the backend with nodejs and python so the indexing and uploading of data is done in elasticsearch-py. I'm having some errors with that. In the first part of that, I create my own mapping and analyzer. This is how they look like:

```
{
  "mappings": {
    "test": {
      "properties": {
        "age": {
          "type": "long"
        },
        "topic_content": {
          "type": "string",
          "analyzer": "my_custom_analyzer",
          "term_vector": "yes"
        },
        "name": {
          "type": "string",
          "analyzer": "my_custom_analyzer",
          "term_vector": "yes"
        }
      }
    }
  },
  "analysis": {
    "analyzer": {
      "my_custom_analyzer": {
        "filter": [
          "lowercase",
          "kstem"
        ],
        "char filter": [
          "html_strip"
        ],
        "type": "custom",
        "tokenizer": "classic"
      }
    }
  }
}

```

I then upload the data using the es.indices.create method in python. This is where I'm getting an error that my analyzer doesn't exist but I can see it being created so I'm confused on why I am getting this error.

`es.indices.create(index = project.uid, ignore=400, body=settings)`

Edit: settings above refers to the object containing my mappings and my analyzer.

```
{
  "error": {
    "root_cause": [
      {
        "type": "mapper_parsing_exception",
        "reason": "analyzer [my_custom_analyzer] not found for field [topic_content]"
      }
    ],
    "type": "mapper_parsing_exception",
    "reason": "Failed to parse mapping [test]: analyzer [my_custom_analyzer] not found for field [topic_content]",
    "caused_by": {
      "type": "mapper_parsing_exception",
      "reason": "analyzer [my_custom_analyzer] not found for field [topic_content]"
    }
  },
  "status": 400
}
```

---

<div class="post-metadata">

**Author:** ![johtani](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/johtani/32/44956_2.png) [@johtani](https://discuss.elastic.co/u/johtani)\
**Post date:** [July 4, 2016, 2:34am UTC](https://discuss.elastic.co/t/error-mapper-parsing-exception-reason-analyzer-my-custom-analyzer-not-found-for-field-topic-content/54543/2 "2016-07-04T02:34:38Z")

</div>

Hi,

You should put "analysis" into "settings", like the following:

```auto
{
  "mappings": {
   ...
  },
  "settings": {
    "analysis": {
      "analyzer": {
        "my_custom_analyzer": {
          "filter": [
            "lowercase",
            "kstem"
          ],
          "char filter": [
            "html_strip"
          ],
          "type": "custom",
          "tokenizer": "classic"
        }
      }
    }
  }
}

```

See: [https://www.elastic.co/guide/en/elasticsearch/guide/current/configuring-analyzers.html](https://www.elastic.co/guide/en/elasticsearch/guide/current/configuring-analyzers.html)

---

<div class="post-metadata">

**Author:** ![kausik93](https://avatars.discourse-cdn.com/v4/letter/k/e19b73/32.png) [@kausik93](https://discuss.elastic.co/u/kausik93)\
**Post date:** [July 4, 2016, 2:37am UTC](https://discuss.elastic.co/t/error-mapper-parsing-exception-reason-analyzer-my-custom-analyzer-not-found-for-field-topic-content/54543/3 "2016-07-04T02:37:50Z")

</div>

oh! I must have gotten confused. So that entire structure should be declared as the body variable? (I mean the body = settings in es.indices.create)

---

<div class="post-metadata">

**Author:** ![johtani](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/johtani/32/44956_2.png) [@johtani](https://discuss.elastic.co/u/johtani)\
**Post date:** [July 4, 2016, 2:57am UTC](https://discuss.elastic.co/t/error-mapper-parsing-exception-reason-analyzer-my-custom-analyzer-not-found-for-field-topic-content/54543/4 "2016-07-04T02:57:59Z")

</div>

Ah, yes.  
I added "settings" before "analysis" in your body variable.  
"analysis" property should be IN "settings" property.

Does it make sense?

---

<div class="post-metadata">

**Author:** ![kausik93](https://avatars.discourse-cdn.com/v4/letter/k/e19b73/32.png) [@kausik93](https://discuss.elastic.co/u/kausik93)\
**Post date:** [July 4, 2016, 3:00am UTC](https://discuss.elastic.co/t/error-mapper-parsing-exception-reason-analyzer-my-custom-analyzer-not-found-for-field-topic-content/54543/5 "2016-07-04T03:00:54Z")

</div>

Yes it does!! Thank you for correcting me! I couldn't figure out what was going on for the entire weekend 😅

---

<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, 10:38pm UTC](https://discuss.elastic.co/t/error-mapper-parsing-exception-reason-analyzer-my-custom-analyzer-not-found-for-field-topic-content/54543/6 "2017-07-05T22:38:44Z")

</div>


