# Email Analyzer failing in 0.16.0

**URL:** <https://discuss.elastic.co/t/email-analyzer-failing-in-0-16-0/4333>\
**Category:** Elasticsearch\
**Created:** [May 3, 2011, 7:13pm UTC](https://discuss.elastic.co/t/email-analyzer-failing-in-0-16-0/4333 "2011-05-03T19:13:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![James\_Cook](https://avatars.discourse-cdn.com/v4/letter/j/898d66/32.png) [@James\_Cook](https://discuss.elastic.co/u/James_Cook)\
**Post date:** [May 3, 2011, 7:13pm UTC](https://discuss.elastic.co/t/email-analyzer-failing-in-0-16-0/4333/1 "2011-05-03T19:13:09Z")

</div>

After updating to 0.16.0 from 0.15.2 we began getting some results for  
queries when we weren't expecting results.

For example, while using 0.15.2, the following query returns no hits:

{  
"query": {  
"field" : {  
"accountEmail.address": "me@example.org"  
}  
}  
}

We are using our "email\_regex" analyzer for the accountEmail.address field.  
It is defined here:

index.analysis.analyzer.email\_regex.type=pattern  
index.analysis.analyzer.email\_regex.lowercase=true  
index.analysis.analyzer.email\_regex.pattern=[@.]  
index.analysis.analyzer.email\_regex.stopwords=_none_

So, now with 0.16.0, the above query now returns a match on this record:

[ {  
"\_id" : "ppkc\_admin",  
"dataType" : "profiles",  
"source" : "PPKC",  
"username" : "admin",  
"password" : "ae2b1fca515949e5d54fb22b8ed95575",  
"languagePref" : "en",  
"accountType" : "paid",  
"profileType" : "admin",  
"country" : "US",  
"accountEmail" : {  
"status" : "verified",  
"address" : "someone@example.org"  
},  
"messagingType" : "open"  
} ]

FWIW, if we change our analyzer to the following definition, it works:

index.analysis.analyzer.email\_regex.type=custom  
index.analysis.analyzer.email\_regex.tokenizer=uax\_url\_email  
index.analysis.analyzer.email\_regex.lowercase=true

Perhaps our initial analyzer definition is wrong, or a new bug was  
introduced. We are not sure.

Any help is appreciated.

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [May 3, 2011, 9:10pm UTC](https://discuss.elastic.co/t/email-analyzer-failing-in-0-16-0/4333/2 "2011-05-03T21:10:04Z")

</div>

The way email are tokenized by the standard analyzer (the default analyzer) was changed in Lucene 3.1. Can you post your mappings? Maybe the analyzer is not applied? For a faster turnaround, gist a curl sample of what you expect 🙂  
On Tuesday, May 3, 2011 at 10:13 PM, James Cook wrote:

> After updating to 0.16.0 from 0.15.2 we began getting some results for queries when we weren't expecting results.
> 
> For example, while using 0.15.2, the following query returns no hits:
> 
> {  
> "query": {  
> "field" : {  
> "accountEmail.address": "[me@example.org](mailto:me@example.org)"  
> }  
> }  
> }
> 
> We are using our "email\_regex" analyzer for the accountEmail.address field. It is defined here:
> 
> index.analysis.analyzer.email\_regex.type=pattern  
> index.analysis.analyzer.email\_regex.lowercase=true  
> index.analysis.analyzer.email\_regex.pattern=[@.]  
> index.analysis.analyzer.email\_regex.stopwords=_none_
> 
> So, now with 0.16.0, the above query now returns a match on this record:
> 
> [ {  
> "\_id" : "ppkc\_admin",  
> "dataType" : "profiles",  
> "source" : "PPKC",  
> "username" : "admin",  
> "password" : "ae2b1fca515949e5d54fb22b8ed95575",  
> "languagePref" : "en",  
> "accountType" : "paid",  
> "profileType" : "admin",  
> "country" : "US",  
> "accountEmail" : {  
> "status" : "verified",  
> "address" : "[someone@example.org](mailto:someone@example.org)"  
> },  
> "messagingType" : "open"  
> } ]
> 
> FWIW, if we change our analyzer to the following definition, it works:
> 
> index.analysis.analyzer.email\_regex.type=custom  
> index.analysis.analyzer.email\_regex.tokenizer=uax\_url\_email  
> index.analysis.analyzer.email\_regex.lowercase=true
> 
> Perhaps our initial analyzer definition is wrong, or a new bug was introduced. We are not sure.
> 
> Any help is appreciated.

---

<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:** [July 6, 2017, 4:07am UTC](https://discuss.elastic.co/t/email-analyzer-failing-in-0-16-0/4333/3 "2017-07-06T04:07:03Z")

</div>


