# Efficient searching for email addresses?

**URL:** <https://discuss.elastic.co/t/efficient-searching-for-email-addresses/222758>\
**Category:** Elastic Search\
**Tags:** elastic-app-search\
**Created:** [March 9, 2020, 3:49pm UTC](https://discuss.elastic.co/t/efficient-searching-for-email-addresses/222758 "2020-03-09T15:49:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Iconeer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/iconeer/32/62187_2.png) [@Iconeer](https://discuss.elastic.co/u/Iconeer)\
**Post date:** [March 9, 2020, 3:49pm UTC](https://discuss.elastic.co/t/efficient-searching-for-email-addresses/222758/1 "2020-03-09T15:49:27Z")

</div>

Although AppSearch matches email-addresses quite well, it is too eager at returning documents where only the domain matches.

For instance, when searching for `helpme@gmail.com`, it might also return thousands of documents with "gmail" in the address.

Perhaps creating an additional field with only the first part of the address would help, but the domain is still important for the search nonetheless. Also, adding more fields has performance impact.

What would be a good and efficient way of searching for email-addresses?

---

<div class="post-metadata">

**Author:** ![JasonStoltz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasonstoltz/32/49893_2.png) [@JasonStoltz](https://discuss.elastic.co/u/JasonStoltz)\
**Post date:** [March 10, 2020, 10:40am UTC](https://discuss.elastic.co/t/efficient-searching-for-email-addresses/222758/2 "2020-03-10T10:40:32Z")

</div>

@Iconeer I would try indexing email into multiple fields, as you suggest. You could then boost (or negative boost) the two fields separately, depending on the type of relevance you are looking for.

I wouldn't expect adding an additional field or two to have much impact on performance.

---

<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 7, 2020, 10:40am UTC](https://discuss.elastic.co/t/efficient-searching-for-email-addresses/222758/3 "2020-04-07T10:40:52Z")

</div>

Closed on April 7, 2020, 10:40am UTC

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