# Java code to strip HTML and do Unique?

**URL:** <https://discuss.elastic.co/t/java-code-to-strip-html-and-do-unique/82056>\
**Category:** Elasticsearch\
**Created:** [April 11, 2017, 9:27pm UTC](https://discuss.elastic.co/t/java-code-to-strip-html-and-do-unique/82056 "2017-04-11T21:27:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![billnbell](https://avatars.discourse-cdn.com/v4/letter/b/eb8c5e/32.png) [@billnbell](https://discuss.elastic.co/u/billnbell)\
**Post date:** [April 11, 2017, 9:27pm UTC](https://discuss.elastic.co/t/java-code-to-strip-html-and-do-unique/82056/1 "2017-04-11T21:27:00Z")

</div>

We have fields that are created just for indexing, and we would like to strip the HTML and make it unique, before we put it into the field. I was thinking maybe we can just use the tokenizer filter directly to do this in Java - but couldn't make heads or tails on how to use that API ?

Thanks!

---

<div class="post-metadata">

**Author:** ![billnbell](https://avatars.discourse-cdn.com/v4/letter/b/eb8c5e/32.png) [@billnbell](https://discuss.elastic.co/u/billnbell)\
**Post date:** [April 11, 2017, 9:29pm UTC](https://discuss.elastic.co/t/java-code-to-strip-html-and-do-unique/82056/2 "2017-04-11T21:29:02Z")

</div>

So for example:

\< p \> Hello there \< /p \> -\> Hello There.

This is a repeat repeat repeat -\> This is a repeat

We want to store those in the \_source field that way and save a ton of disk space. Basically we are good with storing it in \_source but want to remove the HTML and do unique tokenization and then string it together and put into the normal PUT.

---

<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:** [May 9, 2017, 9:34pm UTC](https://discuss.elastic.co/t/java-code-to-strip-html-and-do-unique/82056/3 "2017-05-09T21:34:35Z")

</div>

Closed on May 9, 2017, 9:34pm UTC

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