# Pattern type search in Elasticsearch

**URL:** <https://discuss.elastic.co/t/pattern-type-search-in-elasticsearch/179243>\
**Category:** Elasticsearch\
**Created:** [May 1, 2019, 7:22pm UTC](https://discuss.elastic.co/t/pattern-type-search-in-elasticsearch/179243 "2019-05-01T19:22:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Phani\_Nadiminti](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/phani_nadiminti/32/45381_2.png) [@Phani\_Nadiminti](https://discuss.elastic.co/u/Phani_Nadiminti)\
**Post date:** [May 1, 2019, 7:22pm UTC](https://discuss.elastic.co/t/pattern-type-search-in-elasticsearch/179243/1 "2019-05-01T19:22:44Z")

</div>

Hello ,

I have two records like following.

record 1:

{  
"codes" : "^|25325|UTY|4|^|58357|MKE|4|^|350082|MOT|3|^|25317|MTC|4|^|353501|MCE|1|"  
}

record 2:

{  
"codes" : "^|25325|MTC|4|^|58357|MTC|4|^|350082|MOT|3|^|25317|MTC|4|^|353501|MCE|1|"  
}

For above data index schema is

"codes": {  
"type": "text",  
"fields": {  
"raw": {  
"type": "keyword",  
"ignore\_above": 256  
}  
}  
}

When i search for |25325|MTC| the second record should return but it is returning both records . but i want exact match .  
Tried pattern analyzers but not working as expected . please advice me how to achieve this.

Thanks  
Phani

---

<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 29, 2019, 7:22pm UTC](https://discuss.elastic.co/t/pattern-type-search-in-elasticsearch/179243/2 "2019-05-29T19:22:46Z")

</div>

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