# A better way to implement an analyzer coded by myself into elastic search

**URL:** <https://discuss.elastic.co/t/a-better-way-to-implement-an-analyzer-coded-by-myself-into-elastic-search/305872>\
**Category:** Elasticsearch\
**Created:** [May 29, 2022, 9:53am UTC](https://discuss.elastic.co/t/a-better-way-to-implement-an-analyzer-coded-by-myself-into-elastic-search/305872 "2022-05-29T09:53:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gresmir](https://avatars.discourse-cdn.com/v4/letter/g/e47c2d/32.png) [@Gresmir](https://discuss.elastic.co/u/Gresmir)\
**Post date:** [May 29, 2022, 9:53am UTC](https://discuss.elastic.co/t/a-better-way-to-implement-an-analyzer-coded-by-myself-into-elastic-search/305872/1 "2022-05-29T09:53:07Z")

</div>

Hello  
In my textual data, I have structures like this:

```auto
ст. ст. 40, 131, 132, 176-178, 183, ч. 2 ст. 187, 188, 184, 189, 194 KK

```

Where KK is the name of a codex, ст. ст., or ст. mean article, ч. mean part.  
So I want Elasticsearch to store them like inverted indexes (similar to text fields) and inverted indexes are

```auto
40 KK, 131 KK, ..... 194 KK.

```

So I have a Python code that implements this and I plan to form a string with delimiters like simply ",". Then use the built-in tokeniser so Elasticsearch will build me an inverted index as I want.

My question is if there is a better solution like writing my own analyzer by cloning and modifying an existing one and injecting it into the elastic structure. Or I missed something and I can do the same with already existing analyzers.

Thanks in advance for your reply.

---

<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:** [June 26, 2022, 9:53am UTC](https://discuss.elastic.co/t/a-better-way-to-implement-an-analyzer-coded-by-myself-into-elastic-search/305872/2 "2022-06-26T09:53:39Z")

</div>

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