# How to change tokenizer in elasticsearch in the existing index

**URL:** <https://discuss.elastic.co/t/how-to-change-tokenizer-in-elasticsearch-in-the-existing-index/13238>\
**Category:** Elasticsearch\
**Created:** [August 16, 2013, 9:00am UTC](https://discuss.elastic.co/t/how-to-change-tokenizer-in-elasticsearch-in-the-existing-index/13238 "2013-08-16T09:00:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sada](https://avatars.discourse-cdn.com/v4/letter/s/3bc359/32.png) [@sada](https://discuss.elastic.co/u/sada)\
**Post date:** [August 16, 2013, 9:00am UTC](https://discuss.elastic.co/t/how-to-change-tokenizer-in-elasticsearch-in-the-existing-index/13238/1 "2013-08-16T09:00:52Z")

</div>

Hi!

I have the following problem: I have an index of 30 million documents the mapping as follows:

curl -XPUT localhost:8080/xxxxx/yyyyy/\_mapping?pretty=true -d '{"xxxxx":{"\_id":{"type":"string","index":"not\_analyzed"},"properties":{"content":  
{"type":"string","store":"no"},"title":{"type":"string","index":"no"},"created\_date":{"type":"integer","index":"not\_analyzed"},"url":  
{"type":"string","index":"not\_analyzed"},"author":{"type":"string","index":"no"},"author\_url":{"type":"string","index":"no"},"domain":  
{"type":"string","index":"not\_analyzed"},"lang":{"type":"string","index":"no"}}}}'

Tokenizer is not selected in the settings, so apply a standard. I would like to request "facets" to create ranking links(url) in field "content". Unfortunately I can not do that because the standard tokenizer shared links (url) to pieces. Question: Can an existing index without reindexing change the tokenizer, so that new documents added to the index handle the new tokenizer (uax\_url\_email) and old documents remain unchanged.

I tried that:

curl -XPUT localhost:8080/xxxxx -d '{  
"settings" : {  
"index": {  
"analysis" :{  
"analyzer": {  
"default": {  
"type" : "custom",  
"tokenizer" : "uax\_url\_email",  
"filter" : "lowercase"  
}  
}  
}  
}  
}  
}  
'

but I get an error: {"error": "IndexAlreadyExistsException [[xxxxx] Already exists]", "status": 400}

Is there another way to not reindex with query "facets" to create ranking links (url)?

Thank you in advance of any help

---

<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, 2:20am UTC](https://discuss.elastic.co/t/how-to-change-tokenizer-in-elasticsearch-in-the-existing-index/13238/2 "2017-07-06T02:20:54Z")

</div>


