# Index new field with no special chars during indexing

**URL:** <https://discuss.elastic.co/t/index-new-field-with-no-special-chars-during-indexing/117372>\
**Category:** Elasticsearch\
**Created:** [January 28, 2018, 3:10pm UTC](https://discuss.elastic.co/t/index-new-field-with-no-special-chars-during-indexing/117372 "2018-01-28T15:10:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ramchjob](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ramchjob/32/31480_2.png) [@ramchjob](https://discuss.elastic.co/u/ramchjob)\
**Post date:** [January 28, 2018, 3:10pm UTC](https://discuss.elastic.co/t/index-new-field-with-no-special-chars-during-indexing/117372/1 "2018-01-28T15:10:19Z")

</div>

Dear Gurus,

I have case here, I would like to create an index with phone numbers in it. The phone numbers could be coming in different formats with spaces and special characters in it. I would like to create a new derived field with no spaces and special characters in the new field. I see there is pattern replace, But i would like to use copy\_to as well.

Please let me know , thanks in advance.

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [January 29, 2018, 8:34am UTC](https://discuss.elastic.co/t/index-new-field-with-no-special-chars-during-indexing/117372/2 "2018-01-29T08:34:36Z")

</div>

check out the [ingest node](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/ingest.html) and its features - this way you could preprocess the numbers already in one format and go from there. As all of this happens before the lucene analysis (the JSON document gets enriched), using this with `copy_to` is fine.

--Alex

---

<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:** [February 26, 2018, 8:34am UTC](https://discuss.elastic.co/t/index-new-field-with-no-special-chars-during-indexing/117372/3 "2018-02-26T08:34:40Z")

</div>

Closed on February 26, 2018, 8:34am UTC

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