# Custom Analyzer versus Ingest Pipeline

**URL:** <https://discuss.elastic.co/t/custom-analyzer-versus-ingest-pipeline/228941>\
**Category:** Elasticsearch\
**Created:** [April 20, 2020, 10:36pm UTC](https://discuss.elastic.co/t/custom-analyzer-versus-ingest-pipeline/228941 "2020-04-20T22:36:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gigabyte87](https://avatars.discourse-cdn.com/v4/letter/g/858c86/32.png) [@gigabyte87](https://discuss.elastic.co/u/gigabyte87)\
**Post date:** [April 20, 2020, 10:36pm UTC](https://discuss.elastic.co/t/custom-analyzer-versus-ingest-pipeline/228941/1 "2020-04-20T22:36:23Z")

</div>

Hello,

I'm having some trouble playing around with a custom analyzer. I created an index with a custom analyzer to map IT to Italy, and reindexed to the new index. The search features work, I can search "Italy" and it finds the documents that contain "IT". However, I want to know if the data can/should be manipulated after the reindex to reflect the change. All my documents still show "IT". I know I can do this with an ingest pipeline, but I'm wondering why it doesn't work with the analyzers.

```auto
PUT kibana_sample_data_flights6
{
  "settings": {
    "analysis": {
      "char_filter": {
        "IT_filter": {
          "type": "mapping",
          "mappings": "IT => Italy"
          
        }
      },
      "analyzer": {
        "content_anaylzer": {
          "tokenizer": "keyword",
          "char_filter": ["IT_filter"]
        }
      }
    }
  },
  "mappings": {
    "properties": {
      "DestCountry": {
        "type": "text",
        "analyzer": "content_anaylzer"
      }
    }
  }
}
POST _reindex
{
  "source": {
    "index": "kibana_sample_data_flights"
  },
  "dest": {
    "index": "kibana_sample_data_flights6"
  }
}

```

---

<div class="post-metadata">

**Author:** ![KrishnaShah7](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/krishnashah7/32/66810_2.png) [@KrishnaShah7](https://discuss.elastic.co/u/KrishnaShah7)\
**Post date:** [April 21, 2020, 1:07am UTC](https://discuss.elastic.co/t/custom-analyzer-versus-ingest-pipeline/228941/2 "2020-04-21T01:07:28Z")

</div>

Hi @gigabyte87 : Welcome to the community!  
When you work with custom analyzers, they would never change/touch the "\_source" form of the data. If you do a simple search : index/\_search, you get all your documents under "\_source" context. That is your raw data. Analyzers would not change that. However if you do a specific search to search only "Italy" it would fetch you what you are looking for.

In order to change the \_source, you might have to go for ingest pipelines or scripting.  
Hope that answers your question.

---

<div class="post-metadata">

**Author:** ![gigabyte87](https://avatars.discourse-cdn.com/v4/letter/g/858c86/32.png) [@gigabyte87](https://discuss.elastic.co/u/gigabyte87)\
**Post date:** [April 21, 2020, 1:32am UTC](https://discuss.elastic.co/t/custom-analyzer-versus-ingest-pipeline/228941/3 "2020-04-21T01:32:10Z")

</div>

Thank you! That makes sense now. I knew I could do it with the ingest pipeline but wasn't sure about analyzers. I just needed some confirmation.

---

<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:** [May 19, 2020, 1:32am UTC](https://discuss.elastic.co/t/custom-analyzer-versus-ingest-pipeline/228941/4 "2020-05-19T01:32:18Z")

</div>

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