# Custom tokenizer for phone numbers

**URL:** <https://discuss.elastic.co/t/custom-tokenizer-for-phone-numbers/11306>\
**Category:** Elasticsearch\
**Created:** [March 25, 2013, 10:34pm UTC](https://discuss.elastic.co/t/custom-tokenizer-for-phone-numbers/11306 "2013-03-25T22:34:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![asanderson](https://avatars.discourse-cdn.com/v4/letter/a/8e8cbc/32.png) [@asanderson](https://discuss.elastic.co/u/asanderson)\
**Post date:** [March 25, 2013, 10:34pm UTC](https://discuss.elastic.co/t/custom-tokenizer-for-phone-numbers/11306/1 "2013-03-25T22:34:35Z")

</div>

Greetings!

I'm trying to figure out how to define a custom tokenizer for phone numbers  
similar to how we tokenize phone number in Solr using the  
solr.WordDelimiterFilterFactory[http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters#solr.WordDelimiterFilterFactory](http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters#solr.WordDelimiterFilterFactory) with  
all the parameters set to true.

So, the following tokens would be generated for (111) 222-3333: (111)  
222-3333, 1112223333, 111, 222, 3333.

How would I define a similar custom tokenizer in ElasticSearch?

Thanks in advance.

p.s. Since ElasticSearch supports email and url tokenization out of the  
box, how about adding a standard telephone number tokenizer? Thoughts?

Steve

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [March 26, 2013, 2:49pm UTC](https://discuss.elastic.co/t/custom-tokenizer-for-phone-numbers/11306/2 "2013-03-26T14:49:03Z")

</div>

You can still use

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

On Monday, March 25, 2013 6:34:35 PM UTC-4, asanderson wrote:

> Greetings!
> 
> I'm trying to figure out how to define a custom tokenizer for phone  
> numbers similar to how we tokenize phone number in Solr using the  
> solr.WordDelimiterFilterFactory[http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters#solr.WordDelimiterFilterFactory](http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters#solr.WordDelimiterFilterFactory) with  
> all the parameters set to true.
> 
> So, the following tokens would be generated for (111) 222-3333: (111)  
> 222-3333, 1112223333, 111, 222, 3333.
> 
> How would I define a similar custom tokenizer in Elasticsearch?
> 
> Thanks in advance.
> 
> p.s. Since Elasticsearch supports email and url tokenization out of the  
> box, how about adding a standard telephone number tokenizer? Thoughts?
> 
> Steve

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![asanderson](https://avatars.discourse-cdn.com/v4/letter/a/8e8cbc/32.png) [@asanderson](https://discuss.elastic.co/u/asanderson)\
**Post date:** [March 26, 2013, 7:17pm UTC](https://discuss.elastic.co/t/custom-tokenizer-for-phone-numbers/11306/3 "2013-03-26T19:17:34Z")

</div>

> You can still use  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/index-modules/analysis/word-delimiter-tokenfilter.html)

Igor,

I'm not sure how I missed that, but thanks for pointing me to it. 😉

Steve

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 1:27am UTC](https://discuss.elastic.co/t/custom-tokenizer-for-phone-numbers/11306/8 "2017-07-06T01:27:03Z")

</div>


