# Error in custom analyzer and mappings in ES v7

**URL:** <https://discuss.elastic.co/t/error-in-custom-analyzer-and-mappings-in-es-v7/218593>\
**Category:** Elasticsearch\
**Created:** [February 10, 2020, 1:16pm UTC](https://discuss.elastic.co/t/error-in-custom-analyzer-and-mappings-in-es-v7/218593 "2020-02-10T13:16:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![prasad98](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/prasad98/32/64837_2.png) [@prasad98](https://discuss.elastic.co/u/prasad98)\
**Post date:** [February 10, 2020, 1:16pm UTC](https://discuss.elastic.co/t/error-in-custom-analyzer-and-mappings-in-es-v7/218593/1 "2020-02-10T13:16:46Z")

</div>

Hi, I'm trying to migrate my ES setup from 2.3 to 7.5. However, I'm facing an error with my custom analyzer:

```auto
elastic: Error 400 (Bad Request): analyzer [keyword_lowercase_remove_space] not found for field [identity_exact] [type=mapper_parsing_exception]

```

My mappings and analyzer settings look like this:

```auto
{
  "settings": {
    "analysis": {
      "analyzer": {
        "keyword_lowercase_remove_space": {
            "type": "custom",
	        "tokenizer": "keyword",
	        "filter": []string{"lowercase", "keyword_repeat", "minimal_eng_stem", "custom_unique", "filter_whitespace_remove"}
        }
      }
    }
  },
  "mappings": {
    "properties": {
      "promotions": {
        "properties": {
          "product_name": {
            "type": "text",
            "fields": {
              "identity_exact": {
                "type": "text",
                "analyzer": "keyword_lowercase_remove_space"
              }
            }
          }
        }
      }
    }
  }
}

```

I'm not able to debug the problem, why this problem is occurring. I've gone through the breaking change documentation but didn't found any relevant solution. It would be great if anyone can help me through this.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 10, 2020, 2:56pm UTC](https://discuss.elastic.co/t/error-in-custom-analyzer-and-mappings-in-es-v7/218593/2 "2020-02-10T14:56:25Z")

</div>

I don't have the same message:

```auto
DELETE test 
PUT test
{
  "settings": {
    "analysis": {
      "analyzer": {
        "keyword_lowercase_remove_space": {
          "type": "custom",
          "tokenizer": "keyword",
          "filter": [
            "lowercase",
            "keyword_repeat",
            "minimal_eng_stem",
            "custom_unique",
            "filter_whitespace_remove"
          ]
        }
      }
    }
  },
  "mappings": {
    "properties": {
      "promotions": {
        "properties": {
          "product_name": {
            "type": "text",
            "fields": {
              "identity_exact": {
                "type": "text",
                "analyzer": "keyword_lowercase_remove_space"
              }
            }
          }
        }
      }
    }
  }
}

```

I'm getting:

```auto
{
  "error": {
    "root_cause": [
      {
        "type": "remote_transport_exception",
        "reason": "[instance-0000000020][172.17.0.43:19461][indices:admin/create]"
      }
    ],
    "type": "illegal_argument_exception",
    "reason": "Custom Analyzer [keyword_lowercase_remove_space] failed to find filter under name [minimal_eng_stem]"
  },
  "status": 400
}

```

Which is expected as `minimal_eng_stem` is not defined.

---

<div class="post-metadata">

**Author:** ![prasad98](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/prasad98/32/64837_2.png) [@prasad98](https://discuss.elastic.co/u/prasad98)\
**Post date:** [February 10, 2020, 5:30pm UTC](https://discuss.elastic.co/t/error-in-custom-analyzer-and-mappings-in-es-v7/218593/3 "2020-02-10T17:30:29Z")

</div>

```auto
PUT /test-index-v2/
{
  "settings": {
    "analysis": {
      "filter": {
        "minimal_eng_stem": {
          "type": "stemmer",
          "name": "minimal_english"
        },
        "custom_unique": {
          "type": "unique",
          "only_on_same_position": "true"
        },
        "filter_whitespace_remove": {
          "type": "pattern_replace",
          "pattern": " ",
          "replacement": ""
        }
      },
      "analyzer": {
        "keyword_lowercase_remove_space": {
          "type": "custom",
          "tokenizer": "keyword",
          "filters": ["lowercase", "keyword_repeat", "minimal_eng_stem", "custom_unique", "filter_whitespace_remove"]
        }
      }
    }
  },
  "mappings": {
    "properties": {
      "promotions": {
        "properties": {
          "merchant_product": {
            "type": "text",
            "fields": {
              "identity_exact": {
                "type": "text",
                "analyzer": "keyword_lowercase_remove_space"
              }
            }
          }
        }
      }
    }
  }
}

```

I've updated this query. This query is giving me same error when I try to create index using `NewIndicesCreateService` in Golang ES client API and call `NewIndicesPutMappingService` to put mappings.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 10, 2020, 6:12pm UTC](https://discuss.elastic.co/t/error-in-custom-analyzer-and-mappings-in-es-v7/218593/4 "2020-02-10T18:12:34Z")

</div>

When I run it from the Kibana dev console, it works fine.  
So I'm guessing there's something wrong with your code or with the Golang ES client you are using.

---

<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:** [March 9, 2020, 6:12pm UTC](https://discuss.elastic.co/t/error-in-custom-analyzer-and-mappings-in-es-v7/218593/5 "2020-03-09T18:12:35Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
