# Need help in selecting right analyzer for exact string match with offsets

**URL:** <https://discuss.elastic.co/t/need-help-in-selecting-right-analyzer-for-exact-string-match-with-offsets/89422>\
**Category:** Elasticsearch\
**Created:** [June 14, 2017, 4:42pm UTC](https://discuss.elastic.co/t/need-help-in-selecting-right-analyzer-for-exact-string-match-with-offsets/89422 "2017-06-14T16:42:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nanosoft](https://avatars.discourse-cdn.com/v4/letter/n/aeb1de/32.png) [@nanosoft](https://discuss.elastic.co/u/nanosoft)\
**Post date:** [June 14, 2017, 4:42pm UTC](https://discuss.elastic.co/t/need-help-in-selecting-right-analyzer-for-exact-string-match-with-offsets/89422/1 "2017-06-14T16:42:14Z")

</div>

I am new to elasticsearch. In my case I have html files all containing 2 exactly matching strings. My job is to find those 2 strings and capture the text between them. So if I can get offset of first string and offset of second string then it can be captured. Now when I index these html files, \_AFAIK _search api doesn't give offsets but analyze api does_. Please note **getting offsets is the goal**. I am a java developer so I am using java to write elasticsearch client and try to make calls to \_analyze to fetch json with offsets. I don't know elastic search api much as well. And I am not sure which analyzer to use and which combination of filters and tokenizers would be best in this case. I know this is a trivial question but for me now its a bit confusing.

Thanks in advance.

---

<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 12, 2017, 4:42pm UTC](https://discuss.elastic.co/t/need-help-in-selecting-right-analyzer-for-exact-string-match-with-offsets/89422/2 "2017-07-12T16:42:15Z")

</div>

Closed on July 12, 2017, 4:42pm UTC

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