# \[.NET\] UAX URL Email Tokenizer Issue

**URL:** <https://discuss.elastic.co/t/net-uax-url-email-tokenizer-issue/109367>\
**Category:** Elasticsearch\
**Created:** [November 28, 2017, 10:52am UTC](https://discuss.elastic.co/t/net-uax-url-email-tokenizer-issue/109367 "2017-11-28T10:52:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MT\_WSM](https://avatars.discourse-cdn.com/v4/letter/m/e274bd/32.png) [@MT\_WSM](https://discuss.elastic.co/u/MT_WSM)\
**Post date:** [November 28, 2017, 10:52am UTC](https://discuss.elastic.co/t/net-uax-url-email-tokenizer-issue/109367/1 "2017-11-28T10:52:57Z")

</div>

Hi,

I have been using Elasticsearch through Nest (.NET technology) for a while now. I am currently working on an application where the user can do some search and more precisely looking for someone by typing an email for example.

After some tests and some research, I noticed that working on emails will request to set an uax\_url\_email tokenizer while creating the given index. Sadly, I have some issue to set this setting correctly and I can't retrieve the users while typing their email. Here is my code:

> var result = client?.CreateIndex(indexName, i =\> i
> 
> // Auto mapping with our UserModel entity  
> .Mappings(ms =\> ms.Map(m =\> m.AutoMap()))
> 
> // Setting an analyzer to use an uax\_url\_email tokenizer  
> .Settings(s =\> s.Analysis(a =\> a.Analyzers(aa =\> aa.Custom("my\_analyzer", t =\> t.Tokenizer("my\_tokenizer"))).Tokenizers(n =\> n.UaxEmailUrl("my\_tokenizer", t =\> t)))));

As the second comment is saying, I am using an analyzer to use the needed tokenizer since I can't find any attribute working with this last one for the Attribute Mapping:

> [Text(Analyzer = "my\_analyzer")]  
> public string Email { get; set; }

If anyone has some time, could you guys help me with this situation ? Otherwise, is there an attribute that I may not be aware of for the tokenizer and that will prevent me to create the analyzer ?

I thank you in advance and wish you a great day !  
Best regards,  
MT WSM

---

<div class="post-metadata">

**Author:** ![MT\_WSM](https://avatars.discourse-cdn.com/v4/letter/m/e274bd/32.png) [@MT\_WSM](https://discuss.elastic.co/u/MT_WSM)\
**Post date:** [November 29, 2017, 4:23pm UTC](https://discuss.elastic.co/t/net-uax-url-email-tokenizer-issue/109367/2 "2017-11-29T16:23:14Z")

</div>

Hi guys,

Sorry, but the issue was coming from my test. The above code is working perfectly fine !

N.B.: When I copied-pasted my code, I forgot a piece of it:

> // Auto mapping with our UserModel entity  
> .Mappings(ms =\> ms.Map(m =\> m.AutoMap()))
> 
> // Shoud be:
> 
> // Auto mapping with the UserModel entity  
> .Mappings(ms =\> ms.Map/\</UserModel/\>/(m =\> m.AutoMap()

EDIT: Apparently, it was the quote system that removed the missing part... Remove the for '/' characters to retrieve the correct code.

Best regards,  
MT WSM

---

<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:** [December 27, 2017, 4:23pm UTC](https://discuss.elastic.co/t/net-uax-url-email-tokenizer-issue/109367/3 "2017-12-27T16:23:19Z")

</div>

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