# Email Search Fail. How to solve

**URL:** <https://discuss.elastic.co/t/email-search-fail-how-to-solve/181640>\
**Category:** Elasticsearch\
**Created:** [May 17, 2019, 7:04pm UTC](https://discuss.elastic.co/t/email-search-fail-how-to-solve/181640 "2019-05-17T19:04:11Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![RaTheDev](https://avatars.discourse-cdn.com/v4/letter/r/c5a1d2/32.png) [@RaTheDev](https://discuss.elastic.co/u/RaTheDev)\
**Post date:** [May 17, 2019, 7:04pm UTC](https://discuss.elastic.co/t/email-search-fail-how-to-solve/181640/1 "2019-05-17T19:04:11Z")

</div>

Having issue with my Email address field.  
I have email address stored in upper case and when I search for those IDs in lower case from Java it says there are no records found.  
Tried using Analyzer it doesnt help me.

GET /student-index/\_search?q=_[student.student1@student.com](mailto:student.student1@student.com)_

Value stored as :  
{  
"stuEmail":"STUDENT.STUDENT1@student.com"  
}

---

<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:** [May 17, 2019, 7:37pm UTC](https://discuss.elastic.co/t/email-search-fail-how-to-solve/181640/2 "2019-05-17T19:37:02Z")

</div>

Could you try:

```
GET /student-index/_search?q=stuEmail:student.student1@student.com
```

---

<div class="post-metadata">

**Author:** ![RaTheDev](https://avatars.discourse-cdn.com/v4/letter/r/c5a1d2/32.png) [@RaTheDev](https://discuss.elastic.co/u/RaTheDev)\
**Post date:** [May 17, 2019, 7:40pm UTC](https://discuss.elastic.co/t/email-search-fail-how-to-solve/181640/3 "2019-05-17T19:40:31Z")

</div>

Thanks for reply,  
I tried it but it doesn't work.

But also to be noted, User can search with stuName, or stuNumber or any field related to Student. (Email is one among them).  
So I cannot restrict my query to field name.

---

<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:** [May 17, 2019, 8:32pm UTC](https://discuss.elastic.co/t/email-search-fail-how-to-solve/181640/4 "2019-05-17T20:32:42Z")

</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:** ![RaTheDev](https://avatars.discourse-cdn.com/v4/letter/r/c5a1d2/32.png) [@RaTheDev](https://discuss.elastic.co/u/RaTheDev)\
**Post date:** [May 21, 2019, 2:35am UTC](https://discuss.elastic.co/t/email-search-fail-how-to-solve/181640/5 "2019-05-21T02:35:23Z")

</div>

Sorry for the delay,

Below is my request looks like, when I try from my Java application.

Request 1:  
GET /student\_Records/\_search?q=_[student.student1@student.com](mailto:student.student1@student.com)_

Response 1:

{  
"took" : 8,  
"timed\_out" : false,  
"\_shards" : {  
"total" : 5,  
"successful" : 5,  
"skipped" : 0,  
"failed" : 0  
},  
"hits" : {  
"total" : 1,  
"max\_score" : 7.1873236,  
"hits" : [  
{  
Student details  
}  
]  
}

But if I try the same search with below request (Here the same search string is given in Upper case)

Request 2:  
GET /student\_Records/\_search?q=_[STUDENT.STUDENT1@STUDENT.COM](mailto:STUDENT.STUDENT1@STUDENT.COM)_

Response 2: returns no records as below  
{  
"took" : 20363,  
"timed\_out" : false,  
"\_shards" : {  
"total" : 5,  
"successful" : 5,  
"skipped" : 0,  
"failed" : 0  
},  
"hits" : {  
"total" : 0,  
"max\_score" : null,  
"hits" : []  
}  
}

I am trying to find an example for JAVA API to implement `uax_url_email` tokenizer, but couldnt find one.  
Any help would be appreciated.

---

<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:** [June 2, 2019, 1:40pm UTC](https://discuss.elastic.co/t/email-search-fail-how-to-solve/181640/6 "2019-06-02T13:40:45Z")

</div>

I'm afraid that's not a full example anyone can copy and paste in Kibana dev console to reproduce your problem. Read again [About the Elasticsearch category](https://discuss.elastic.co/t/about-the-elasticsearch-category/21). It contains an example which shows you what you should provide.

---

<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:** [June 30, 2019, 1:40pm UTC](https://discuss.elastic.co/t/email-search-fail-how-to-solve/181640/7 "2019-06-30T13:40:58Z")

</div>

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