# Searching vor numbers

**URL:** <https://discuss.elastic.co/t/searching-vor-numbers/42326>\
**Category:** Elasticsearch\
**Created:** [February 21, 2016, 10:41am UTC](https://discuss.elastic.co/t/searching-vor-numbers/42326 "2016-02-21T10:41:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![eutychus](https://avatars.discourse-cdn.com/v4/letter/e/a3d4f5/32.png) [@eutychus](https://discuss.elastic.co/u/eutychus)\
**Post date:** [February 21, 2016, 10:41am UTC](https://discuss.elastic.co/t/searching-vor-numbers/42326/1 "2016-02-21T10:41:33Z")

</div>

are there any analyzers to translate numbers to text?

I want to have the ability to find values like 20 and zwanzig (twenty) as equals.

TIA  
Eutychus

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [February 21, 2016, 8:00pm UTC](https://discuss.elastic.co/t/searching-vor-numbers/42326/2 "2016-02-21T20:00:59Z")

</div>

You could leverage synonyms - [https://www.elastic.co/guide/en/elasticsearch/reference/2.2/analysis-synonym-tokenfilter.html](https://www.elastic.co/guide/en/elasticsearch/reference/2.2/analysis-synonym-tokenfilter.html)

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [February 22, 2016, 8:39am UTC](https://discuss.elastic.co/t/searching-vor-numbers/42326/3 "2016-02-22T08:39:07Z")

</div>

There are two methods:

- parsing text to generate numbers: "zwanzig" -\> 20
- writing numbers as text: 20 -\> "zwanzig"

Should the index contain numbers or text?

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [February 22, 2016, 4:37pm UTC](https://discuss.elastic.co/t/searching-vor-numbers/42326/4 "2016-02-22T16:37:49Z")

</div>

I have added a "spellout" locale-based number format token filter to my customized ICU implementation, see

> <https://github.com/jprante/elasticsearch-plugin-bundle/commit/6ff3a41cfaf7d1b7d185e8b55e78465dfd41e1b6>

It translates numbers to text, and the text is indexed. So if you have a text with "20" or with "zwanzig", both are indexed as "zwanzig".

Example of a setting:

> <https://github.com/jprante/elasticsearch-plugin-bundle/blob/6ff3a41cfaf7d1b7d185e8b55e78465dfd41e1b6/src/test/resources/org/xbib/elasticsearch/index/analysis/icu/icu_numberformat.json>

Note, the RuleBasedNumberFormat class of ICU which I use for this token filter is working in lenient mode, which is quite slow.

---

<div class="post-metadata">

**Author:** ![eutychus](https://avatars.discourse-cdn.com/v4/letter/e/a3d4f5/32.png) [@eutychus](https://discuss.elastic.co/u/eutychus)\
**Post date:** [February 23, 2016, 5:23pm UTC](https://discuss.elastic.co/t/searching-vor-numbers/42326/5 "2016-02-23T17:23:51Z")

</div>

Thank you for your help.

even if you suggestion seems to be particularly promising it is not possible to me to try it out, because the servers running the elasticsearch service are using openjava 7 ☹

---

<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:14pm UTC](https://discuss.elastic.co/t/searching-vor-numbers/42326/6 "2017-07-05T23:14:09Z")

</div>


