# Analyzer for XML

**URL:** <https://discuss.elastic.co/t/analyzer-for-xml/3946>\
**Category:** Elasticsearch\
**Created:** [February 18, 2011, 10:59am UTC](https://discuss.elastic.co/t/analyzer-for-xml/3946 "2011-02-18T10:59:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![srrin](https://avatars.discourse-cdn.com/v4/letter/s/85f322/32.png) [@srrin](https://discuss.elastic.co/u/srrin)\
**Post date:** [February 18, 2011, 10:59am UTC](https://discuss.elastic.co/t/analyzer-for-xml/3946/1 "2011-02-18T10:59:06Z")

</div>

Hi all,  
Is there any analyzer available for indexing XML data.  
For e.g. If I index a XML data, I need to eliminate the tags and I need to search using the keyword Tove. Jani/ Reminder and retrieve this document for the below XML.

\<?xml version="1.0"?\> Tove Jani Reminder Don't forget me this weekend!

Thanks  
SrrIN

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [February 20, 2011, 1:13am UTC](https://discuss.elastic.co/t/analyzer-for-xml/3946/2 "2011-02-20T01:13:20Z")

</div>

None currently (and its a question of what to make sortable in this case, are elements name sortable or not?). It might actually make sense to convert the XML to a json document so you can do more interesting search, but, in both cases, you need to parse the XML and provide it yourself.  
On Friday, February 18, 2011 at 12:59 PM, srrIN wrote:

> Hi all,  
> Is there any analyzer available for indexing XML data.  
> For e.g. If I index a XML data, I need to eliminate the tags and I need to  
> search using the keyword Tove. Jani/ Reminder and retrieve this document for  
> the below XML.
> 
> \<?xml version="1.0"?\> Tove Jani Reminder Don't forget me this weekend!
> 
> Thanks  
> SrrIN
> 
> --  
> View this message in context: [http://elasticsearch-users.115913.n3.nabble.com/Analyzer-for-XML-tp2525867p2525867.html](http://elasticsearch-users.115913.n3.nabble.com/Analyzer-for-XML-tp2525867p2525867.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![srrin](https://avatars.discourse-cdn.com/v4/letter/s/85f322/32.png) [@srrin](https://discuss.elastic.co/u/srrin)\
**Post date:** [February 21, 2011, 1:24pm UTC](https://discuss.elastic.co/t/analyzer-for-xml/3946/3 "2011-02-21T13:24:00Z")

</div>

Hi Shay,  
Thanks for the reply.

No the element names are not sortable. I need the values to be searchable.

---

<div class="post-metadata">

**Author:** ![Mahendra\_M](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mahendra_m/32/3128_2.png) [@Mahendra\_M](https://discuss.elastic.co/u/Mahendra_M)\
**Post date:** [February 25, 2011, 1:29pm UTC](https://discuss.elastic.co/t/analyzer-for-xml/3946/4 "2011-02-25T13:29:24Z")

</div>

On Sun, Feb 20, 2011 at 6:43 AM, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)wrote:

> None currently (and its a question of what to make sortable in this case,  
> are elements name sortable or not?). It might actually make sense to convert  
> the XML to a json document so you can do more interesting search, but, in  
> both cases, you need to parse the XML and provide it yourself.

Note: I have not tried it myself, but this might help in converting xml to  
json.

> **[GitHub - jeanlopes/xmltooljson: a xml to json converter and import it to couchdb](https://github.com/jeanlopes/xmltooljson/)**
>
> a xml to json converter and import it to couchdb. Contribute to jeanlopes/xmltooljson development by creating an account on GitHub.

--  
Mahendra

[http://twitter.com/mahendra](http://twitter.com/mahendra)

---

<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 6, 2017, 4:11am UTC](https://discuss.elastic.co/t/analyzer-for-xml/3946/5 "2017-07-06T04:11:29Z")

</div>


