# How to search xml data precisely

**URL:** <https://discuss.elastic.co/t/how-to-search-xml-data-precisely/109319>\
**Category:** Elasticsearch\
**Created:** [November 28, 2017, 7:01am UTC](https://discuss.elastic.co/t/how-to-search-xml-data-precisely/109319 "2017-11-28T07:01:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![HelloUniverse](https://avatars.discourse-cdn.com/v4/letter/h/a3d4f5/32.png) [@HelloUniverse](https://discuss.elastic.co/u/HelloUniverse)\
**Post date:** [November 28, 2017, 7:01am UTC](https://discuss.elastic.co/t/how-to-search-xml-data-precisely/109319/1 "2017-11-28T07:01:32Z")

</div>

We have an es index storing some xml data.  
With the english analyzer, the angular brackets will be treated as stop words. Searching "value" equals searching "element value".

How can I manage to search with the angular brackets?

Thanks in advance.

---

<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:** [November 28, 2017, 7:49am UTC](https://discuss.elastic.co/t/how-to-search-xml-data-precisely/109319/2 "2017-11-28T07:49:57Z")

</div>

Hey,

have you thought converting this data to JSON, so you can search for single fields?

The [xml filter plugin](https://www.elastic.co/guide/en/logstash/6.0/plugins-filters-xml.html) from logstash might be a good choice. You could setup logstash with an elasticsearch input to gather the data, modify it, and then store it back in ES, like a reindexing operation.

If you try to parse and analyze XML manually, you will run into so many corner cases and specialtes, I dont think it will save you any time in the long run.

--Alex

---

<div class="post-metadata">

**Author:** ![HelloUniverse](https://avatars.discourse-cdn.com/v4/letter/h/a3d4f5/32.png) [@HelloUniverse](https://discuss.elastic.co/u/HelloUniverse)\
**Post date:** [November 28, 2017, 2:49pm UTC](https://discuss.elastic.co/t/how-to-search-xml-data-precisely/109319/3 "2017-11-28T14:49:31Z")

</div>

Hi Alex,

Thanks for your suggestion. That would be a solution. But not suitable for our case. Actually, the XML data is a kind of our logs, which need be kept its original format.

Maybe I should ask in another words, that, how to do the full-text search while keeping the angular brackets.

---

<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:** [December 26, 2017, 2:49pm UTC](https://discuss.elastic.co/t/how-to-search-xml-data-precisely/109319/4 "2017-12-26T14:49:35Z")

</div>

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