# Analysis of identifiers with dashes

**URL:** <https://discuss.elastic.co/t/analysis-of-identifiers-with-dashes/243350>\
**Category:** Elasticsearch\
**Created:** [July 31, 2020, 12:18pm UTC](https://discuss.elastic.co/t/analysis-of-identifiers-with-dashes/243350 "2020-07-31T12:18:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![romansitina](https://avatars.discourse-cdn.com/v4/letter/r/ee7513/32.png) [@romansitina](https://discuss.elastic.co/u/romansitina)\
**Post date:** [July 31, 2020, 12:18pm UTC](https://discuss.elastic.co/t/analysis-of-identifiers-with-dashes/243350/1 "2020-07-31T12:18:58Z")

</div>

Hello,

I'm trying to solve this issue:

I have text

> Information about **CD-3568** can be found in document **DKF-98346-B-261**

and I need to get it analysed as

> information about **cd-3568** can be found in document **dkf 98346 b 261**

The reason is that CD-xxxx is specific form of identifier which I want to retain.

Is it possible to create such analysis chain with combination of existing analysers and tokenisers without writing custom plugin?

Thanks for any ideas  
Roman

---

<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:** [August 3, 2020, 10:11am UTC](https://discuss.elastic.co/t/analysis-of-identifiers-with-dashes/243350/2 "2020-08-03T10:11:54Z")

</div>

Hey,

there are a couple of solutions to this problem, not sure which one fits you best.

- If you index this field a second time (using a multi field for example) using a `whitespace` tokenizer, that token would be stored as is, and could also be searched like that.
- Maybe (I haven't played around with) the [word delimiter filter](https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-word-delimiter-graph-tokenfilter.html) can help you as well.
- Another solution would be to use a [pattern\_replace char filter](https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-pattern-replace-charfilter.html) and replace the dash with a special character, but that would also require some processing on the search side, so that sounds like too much work to me.

Have you thought about extracting that token into it's own field so simplify searching/filtering for it?

--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:** [August 31, 2020, 10:11am UTC](https://discuss.elastic.co/t/analysis-of-identifiers-with-dashes/243350/3 "2020-08-31T10:11:58Z")

</div>

Closed on August 31, 2020, 10:11am UTC

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