# Alphanumeric Search

**URL:** <https://discuss.elastic.co/t/alphanumeric-search/224901>\
**Category:** Elasticsearch\
**Created:** [March 24, 2020, 5:59pm UTC](https://discuss.elastic.co/t/alphanumeric-search/224901 "2020-03-24T17:59:06Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gopal\_Chauhan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gopal_chauhan/32/51033_2.png) [@Gopal\_Chauhan](https://discuss.elastic.co/u/Gopal_Chauhan)\
**Post date:** [March 24, 2020, 5:59pm UTC](https://discuss.elastic.co/t/alphanumeric-search/224901/1 "2020-03-24T17:59:06Z")

</div>

Hi,

I am trying to Search a alphanumeric value - 1Z74W6A90342550699 against a index. This index does not contain any such value against any fields.

But still I get so many records. Ideally i should not get any record and that is expected.

But is i search complete number like - 2099974873847387 , this search give me expected result.

What is happening at time of alphanumeric search and how i can get expected result?

---

<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:** [March 24, 2020, 6:16pm UTC](https://discuss.elastic.co/t/alphanumeric-search/224901/2 "2020-03-24T18:16:07Z")

</div>

Could you provide a full recreation script as described in [About the Elasticsearch category](https://discuss.elastic.co/t/about-the-elasticsearch-category/21). It will help to better understand what you are doing. Please, try to keep the example as simple as possible.

A full reproduction script will help readers to understand, reproduce and if needed fix your problem. It will also most likely help to get a faster answer.

---

<div class="post-metadata">

**Author:** ![Gopal\_Chauhan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gopal_chauhan/32/51033_2.png) [@Gopal\_Chauhan](https://discuss.elastic.co/u/Gopal_Chauhan)\
**Post date:** [March 24, 2020, 7:09pm UTC](https://discuss.elastic.co/t/alphanumeric-search/224901/3 "2020-03-24T19:09:51Z")

</div>

Hi David,

I am executing below query and it is giving me result in which does not have value - 1Z74W6A90342550699 . Elastic version is 6.2

GET testindex/\_search  
{  
"query": {  
"bool": {  
"must": [  
{  
"simple\_query\_string": {  
"query": "1Z74W6A90342550699"  
}  
}  
]  
}  
}  
}

Thanks,  
Gopal

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [March 24, 2020, 7:16pm UTC](https://discuss.elastic.co/t/alphanumeric-search/224901/4 "2020-03-24T19:16:03Z")

</div>

Look at the mapping of your field. If you are using dynamic mappings and have not specified mappings yourself, strings will be indexed in analyzed form by default while a non-analyzed form that allows exact matching is indexed as a keyword subfield.

If you are looking for exact matching you should use the keyword subfield or create an index template with a custom mapping for your index.

---

<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:** [March 24, 2020, 9:00pm UTC](https://discuss.elastic.co/t/alphanumeric-search/224901/5 "2020-03-24T21:00:44Z")

</div>

Please check the link I provided. It explains how to share a script which could help us to help you.

Thanks

---

<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:** [April 21, 2020, 9:00pm UTC](https://discuss.elastic.co/t/alphanumeric-search/224901/6 "2020-04-21T21:00:45Z")

</div>

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