# How does Elasticsearch treat punctuation marks on index?

**URL:** <https://discuss.elastic.co/t/how-does-elasticsearch-treat-punctuation-marks-on-index/89>\
**Category:** Elasticsearch\
**Created:** [May 1, 2015, 10:14am UTC](https://discuss.elastic.co/t/how-does-elasticsearch-treat-punctuation-marks-on-index/89 "2015-05-01T10:14:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shaunak](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shaunak/32/6643_2.png) [@shaunak](https://discuss.elastic.co/u/shaunak)\
**Post date:** [May 1, 2015, 10:14am UTC](https://discuss.elastic.co/t/how-does-elasticsearch-treat-punctuation-marks-on-index/89/1 "2015-05-01T10:14:19Z")

</div>

#### QUESTION

To my understanding elasticsearch will treat all punctuation marks as word breaker.

We are looking for recommended strategy on how to deal with the scenarios

1. where 'BOO' should be not found when end-user search text is 'BOO!'
2. where 'Men of steel' should not be found when end-user search text is 'x-men'

#### ANSWER

By default, ES uses the "[standard analyzer](http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/standard-analyzer.html)", which itself uses the "[standard tokenizer](http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/standard-tokenizer.html)".

You can create a [custom analyzer](http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/custom-analyzers.html#custom-analyzers) and configure and/or specify a different tokenizer like the whitespace tokenizer which would preserve all punctuations.

You can test your analyzer using [http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/analysis-intro.html#analyze-api](http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/analysis-intro.html#analyze-api)

---

<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, 12:16am UTC](https://discuss.elastic.co/t/how-does-elasticsearch-treat-punctuation-marks-on-index/89/2 "2017-07-06T00:16:17Z")

</div>


