# How to use two custom analyzer for same field?

**URL:** <https://discuss.elastic.co/t/how-to-use-two-custom-analyzer-for-same-field/106018>\
**Category:** Elasticsearch\
**Created:** [November 1, 2017, 10:28am UTC](https://discuss.elastic.co/t/how-to-use-two-custom-analyzer-for-same-field/106018 "2017-11-01T10:28:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![abc1](https://avatars.discourse-cdn.com/v4/letter/a/e47774/32.png) [@abc1](https://discuss.elastic.co/u/abc1)\
**Post date:** [November 1, 2017, 10:28am UTC](https://discuss.elastic.co/t/how-to-use-two-custom-analyzer-for-same-field/106018/1 "2017-11-01T10:28:21Z")

</div>

Here is my mappings. I want use both the analyzer code and point analyzer for the field message but they are not showing any results.Individually both the analyzers are working fine but together they are not giving any ouput . I am using Kibana to see the output after loading logs.  
Kindly help me.

PUT /demo1/_settings?pretty  
{  
"settings" : {  
"analysis" : {  
"filter" : {  
"code" : {  
"type" : "pattern\_capture",  
"preserve\_original" : true,  
"patterns" : [  
"(\p{Ll}+|\p{Lu}\p{Ll}+|\p{Lu}+)",  
"(\d+)"  
]  
}  
},  
"analyzer" : {  
"code" : {  
"tokenizer" : "pattern",  
"filter" : ["code", "lowercase"]  
},  
"point\_analyzer": {  
"type": "pattern",  
"pattern": "\.|\s|\:|\_"  
}

```
     }
  }

```

},  
"mappings": {  
"my\_type": {  
"properties": {  
"message": {  
"type": "string",  
"analyzer": "point\_analyzer"},

```
       "message.keyword": {
          "type": "string",
          
          "analyzer":"code"
       }
    }
  }
}

```

}

---

<div class="post-metadata">

**Author:** ![rjernst](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rjernst/32/6363_2.png) [@rjernst](https://discuss.elastic.co/u/rjernst)\
**Post date:** [November 7, 2017, 9:24pm UTC](https://discuss.elastic.co/t/how-to-use-two-custom-analyzer-for-same-field/106018/2 "2017-11-07T21:24:58Z")

</div>

What do you mean by "together"? Can you given an example indexing and search request, along with what you expect to be returned and what is actually returned?

---

<div class="post-metadata">

**Author:** ![abc1](https://avatars.discourse-cdn.com/v4/letter/a/e47774/32.png) [@abc1](https://discuss.elastic.co/u/abc1)\
**Post date:** [November 9, 2017, 6:36am UTC](https://discuss.elastic.co/t/how-to-use-two-custom-analyzer-for-same-field/106018/3 "2017-11-09T06:36:51Z")

</div>

thanks my confusion got resolved 🙂

---

<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:** [December 7, 2017, 6:37am UTC](https://discuss.elastic.co/t/how-to-use-two-custom-analyzer-for-same-field/106018/4 "2017-12-07T06:37:02Z")

</div>

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