# The tokenizer "uax\_url\_email" doesn't work

**URL:** <https://discuss.elastic.co/t/the-tokenizer-uax-url-email-doesnt-work/45883>\
**Category:** Elasticsearch\
**Created:** [March 31, 2016, 7:35am UTC](https://discuss.elastic.co/t/the-tokenizer-uax-url-email-doesnt-work/45883 "2016-03-31T07:35:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cary.gao](https://avatars.discourse-cdn.com/v4/letter/c/df705f/32.png) [@cary.gao](https://discuss.elastic.co/u/cary.gao)\
**Post date:** [March 31, 2016, 7:35am UTC](https://discuss.elastic.co/t/the-tokenizer-uax-url-email-doesnt-work/45883/1 "2016-03-31T07:35:17Z")

</div>

recently i am trying to study the analyzer of ES, so i try to practice the tokenizer "uax\_url\_email" and pattern pattern\_capture token filter.

As this page [https://www.elastic.co/guide/en/elasticsearch/reference/2.1/analysis-pattern-capture-tokenfilter.html](https://www.elastic.co/guide/en/elasticsearch/reference/2.1/analysis-pattern-capture-tokenfilter.html) said with below analyzer if i input [john-smith\_123@foo-bar.com](mailto:john-smith_123@foo-bar.com) it would produce the following tokens: [john-smith\_123@foo-bar.com](mailto:john-smith_123@foo-bar.com), john-smith\_123, john, smith, 123, [foo-bar.com](http://foo-bar.com), foo, bar, com.

curl -XPUT 10.35.22.80:9200/test\_email/ -d '  
{  
"settings" : {  
"analysis" : {  
"filter" : {  
"email" : {  
"type" : "pattern\_capture",  
"preserve\_original" : 1,  
"patterns" : [  
"([^@]+)",  
"(\p{L}+)",  
"(\d+)",  
"@(.+)"  
]  
}  
},  
"analyzer" : {  
"email" : {  
"tokenizer" : "uax\_url\_email",  
"filter" : ["email", "lowercase", "unique"]  
}  
}  
}  
}  
}'

But when i try the above mapping in my cluster, the output of my cluster are not same as the ES page write. i only got below output. I tried on both 1.7.3 and 2.1.0. Both of them got the same output like below. so does any body know what should i do?  
cloud@g-dev-work:~\> curl 10.35.22.80:9200/test\_email/\_analyze?pretty -d "john-smith\_123@foo-bar.com"  
{  
"tokens" : [ {  
"token" : "john",  
"start\_offset" : 0,  
"end\_offset" : 4,  
"type" : "",  
"position" : 0  
}, {  
"token" : "smith\_123",  
"start\_offset" : 5,  
"end\_offset" : 14,  
"type" : "",  
"position" : 1  
}, {  
"token" : "foo",  
"start\_offset" : 15,  
"end\_offset" : 18,  
"type" : "",  
"position" : 2  
}, {  
"token" : "[bar.com](http://bar.com)",  
"start\_offset" : 19,  
"end\_offset" : 26,  
"type" : "",  
"position" : 3  
} ]  
}

---

<div class="post-metadata">

**Author:** ![cbuescher](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cbuescher/32/60402_2.png) [@cbuescher](https://discuss.elastic.co/u/cbuescher)\
**Post date:** [March 31, 2016, 7:50am UTC](https://discuss.elastic.co/t/the-tokenizer-uax-url-email-doesnt-work/45883/2 "2016-03-31T07:50:23Z")

</div>

> [@cary.gao](#):
>
> curl 10.35.22.80:9200/test\_email/\_analyze?pretty -d "[john-smith\_123@foo-bar.com](mailto:john-smith_123@foo-bar.com)"

You need to tell the \_analyze endpoint which analyzer to use:

`curl "localhost:9200/test_email/_analyze?analyzer=email&pretty" -d "john-smith_123@foo-bar.com"`

---

<div class="post-metadata">

**Author:** ![cary.gao](https://avatars.discourse-cdn.com/v4/letter/c/df705f/32.png) [@cary.gao](https://discuss.elastic.co/u/cary.gao)\
**Post date:** [March 31, 2016, 8:07am UTC](https://discuss.elastic.co/t/the-tokenizer-uax-url-email-doesnt-work/45883/3 "2016-03-31T08:07:25Z")

</div>

That works. Thanks, i sill have lot of info need to learn.😄

---

<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 5, 2017, 11:03pm UTC](https://discuss.elastic.co/t/the-tokenizer-uax-url-email-doesnt-work/45883/4 "2017-07-05T23:03:44Z")

</div>


