# Search doesn't work for email address, return 0 hits

**URL:** <https://discuss.elastic.co/t/search-doesnt-work-for-email-address-return-0-hits/168381>\
**Category:** Elasticsearch\
**Created:** [February 14, 2019, 10:04am UTC](https://discuss.elastic.co/t/search-doesnt-work-for-email-address-return-0-hits/168381 "2019-02-14T10:04:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sachin\_chavan](https://avatars.discourse-cdn.com/v4/letter/s/d26b3c/32.png) [@sachin\_chavan](https://discuss.elastic.co/u/sachin_chavan)\
**Post date:** [February 14, 2019, 10:04am UTC](https://discuss.elastic.co/t/search-doesnt-work-for-email-address-return-0-hits/168381/1 "2019-02-14T10:04:29Z")

</div>

I am using Elasticsearch version **6.4** on AWS

my\_index data from which I will be searching

{  
"snapshot": {  
"last\_name": "Chavan",  
"first\_name": "Sachin",  
"email\_id": "sachin@mail.com",  
"user\_status": "active\_user"  
},  
"tags": [  
"Apple",  
"Sachin",  
"Chavan",  
"sachin@mail.com"  
]  
}

if I search by this `my_index/_search?q=tags:*sa*`-- It works

But if I search for email like this `my_index/_search?q=tags:*@mail*` --- returns 0 hits,

I have gone through some solutions but it seems non of them works, tried for **not\_analyzed** and **uax\_url\_email** tokenizer.

Please help me out here,if you can share exact settings and mapping I have to make while creating index then that will be really helpful.

---

<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:** [February 14, 2019, 10:35am UTC](https://discuss.elastic.co/t/search-doesnt-work-for-email-address-return-0-hits/168381/2 "2019-02-14T10:35:54Z")

</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:** ![RahulD](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@RahulD](https://discuss.elastic.co/u/RahulD)\
**Post date:** [February 15, 2019, 9:13pm UTC](https://discuss.elastic.co/t/search-doesnt-work-for-email-address-return-0-hits/168381/3 "2019-02-15T21:13:00Z")

</div>

You should look into using regexp queries: [https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-regexp-query.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-regexp-query.html)

---

<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:** [March 15, 2019, 9:13pm UTC](https://discuss.elastic.co/t/search-doesnt-work-for-email-address-return-0-hits/168381/4 "2019-03-15T21:13:02Z")

</div>

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