# Custom analyzer is Not effecting to the data of the mapping field,even though i added it to the mapping field

**URL:** <https://discuss.elastic.co/t/custom-analyzer-is-not-effecting-to-the-data-of-the-mapping-field-even-though-i-added-it-to-the-mapping-field/39052>\
**Category:** Elasticsearch\
**Created:** [January 13, 2016, 4:23am UTC](https://discuss.elastic.co/t/custom-analyzer-is-not-effecting-to-the-data-of-the-mapping-field-even-though-i-added-it-to-the-mapping-field/39052 "2016-01-13T04:23:30Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![balubollam](https://avatars.discourse-cdn.com/v4/letter/b/a587f6/32.png) [@balubollam](https://discuss.elastic.co/u/balubollam)\
**Post date:** [January 13, 2016, 4:23am UTC](https://discuss.elastic.co/t/custom-analyzer-is-not-effecting-to-the-data-of-the-mapping-field-even-though-i-added-it-to-the-mapping-field/39052/1 "2016-01-13T04:23:30Z")

</div>

Hi Everyone

I am implementing custom analyzer using follwing example and adding that analyzer to the mapping filed. But that analyzer is not effecting to the mapping field.

EXAMPLE:  
\*first creating analyzer in settings and adding that anaylzer to the field in the mapping  
POST sa  
{  
"settings":{  
"analysis":{  
"analyzer":{  
"full\_name":{  
"filter":"lowercase",  
"type":"custom",  
"tokenizer":"standard"  
}  
}  
}  
},  
"mappings": {  
"check":{  
"properties": {  
"name":{  
"type": "string",  
"analyzer": "full\_name"  
}  
}  
}  
}  
}

\*indexing the data  
POST sa/check/1  
{  
"\_id":1,

"name":"BALU67 Guyfhf"  
}

Now in the above example when i use this GET /sa/\_analyze?analyzer=full\_name/text=YFSDD  
i am getting lowercase letters given in the text attribute.That fine work with that,  
BUT when that analyzer is not applying to the data of the field mapping....  
i.e When i try like his  
GET sa/check/\_seach

I should get the data inside that added mapping field to be lowercase...But getting as it is

Is their any way like that?  
As i am New to this concept any one please help me out  
Thanks

---

<div class="post-metadata">

**Author:** ![pavang6](https://avatars.discourse-cdn.com/v4/letter/p/a6a055/32.png) [@pavang6](https://discuss.elastic.co/u/pavang6)\
**Post date:** [January 13, 2016, 9:44am UTC](https://discuss.elastic.co/t/custom-analyzer-is-not-effecting-to-the-data-of-the-mapping-field-even-though-i-added-it-to-the-mapping-field/39052/2 "2016-01-13T09:44:14Z")

</div>

Hey Balaji,

I have seen two ways to add an custom analyzer.

1. Put a custom analyzer definition globally so that you can share/reuse it among different indices. For this we need use this syntax
2. Make the custom analyzer definition as part of the index mapping definition so that it available only for that index.

In your case you are following the second approach.

Whatever result you receive on executing GET sa/check/\_search is from the \_source field which contains the original JSON document body that was passed at index time.  
[https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-source-field.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-source-field.html)

I think there nothing wrong with the response you are getting. This the expected behavior.

Thanks,  
Pavan

---

<div class="post-metadata">

**Author:** ![balubollam](https://avatars.discourse-cdn.com/v4/letter/b/a587f6/32.png) [@balubollam](https://discuss.elastic.co/u/balubollam)\
**Post date:** [January 14, 2016, 2:56am UTC](https://discuss.elastic.co/t/custom-analyzer-is-not-effecting-to-the-data-of-the-mapping-field-even-though-i-added-it-to-the-mapping-field/39052/3 "2016-01-14T02:56:09Z")

</div>

Thanks a lot .  
Can u please help me how to keep custom analyzer globally so that to apply  
to indices data or ping me any link for that

---

<div class="post-metadata">

**Author:** ![pavang6](https://avatars.discourse-cdn.com/v4/letter/p/a6a055/32.png) [@pavang6](https://discuss.elastic.co/u/pavang6)\
**Post date:** [January 14, 2016, 6:43am UTC](https://discuss.elastic.co/t/custom-analyzer-is-not-effecting-to-the-data-of-the-mapping-field-even-though-i-added-it-to-the-mapping-field/39052/4 "2016-01-14T06:43:45Z")

</div>

Hey,  
check this

> [@Defining Custom analyzers globally](https://discuss.elastic.co/t/defining-custom-analyzers-globally/27826):
>
> We have created our own custom analyzer definition based on our application-wide needs and that is quite different from available analyzers in ElasticSearch like standard or classical analyzers. We have around 30 indices and i want to use this custom analyzer for all these indices. As much as I know and have searched, it seems that i need to include the analyzer definition in all the index definitions which seems like gross duplication of information. Is it possible that I can define a custom …

Thanks,  
Pavan

---

<div class="post-metadata">

**Author:** ![balubollam](https://avatars.discourse-cdn.com/v4/letter/b/a587f6/32.png) [@balubollam](https://discuss.elastic.co/u/balubollam)\
**Post date:** [January 14, 2016, 7:09am UTC](https://discuss.elastic.co/t/custom-analyzer-is-not-effecting-to-the-data-of-the-mapping-field-even-though-i-added-it-to-the-mapping-field/39052/5 "2016-01-14T07:09:46Z")

</div>

Ya thannk u....

I will try it out with the templetes

---

<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:24pm UTC](https://discuss.elastic.co/t/custom-analyzer-is-not-effecting-to-the-data-of-the-mapping-field-even-though-i-added-it-to-the-mapping-field/39052/6 "2017-07-05T23:24:41Z")

</div>


