# Design question

**URL:** <https://discuss.elastic.co/t/design-question/6342>\
**Category:** Elasticsearch\
**Created:** [January 11, 2012, 1:33am UTC](https://discuss.elastic.co/t/design-question/6342 "2012-01-11T01:33:25Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mohit\_Anchlia](https://avatars.discourse-cdn.com/v4/letter/m/848f3c/32.png) [@Mohit\_Anchlia](https://discuss.elastic.co/u/Mohit_Anchlia)\
**Post date:** [January 11, 2012, 1:33am UTC](https://discuss.elastic.co/t/design-question/6342/1 "2012-01-11T01:33:25Z")

</div>

I am just starting to use elasticsearch. We have some documents in EDI  
format and XML format that we need to index. For eg EDI format is  
something like:

0120**TRANA 770034661 PREPARER'S  
AGENTE20080522010080014302AV901005 TZ #  
0120**TRANB 7700346616220 GREENWICH DR SAN DIEGO CA  
92122 8585258010 #  
0120**ACK 5618383330100800143020001000000000000C0004  
200805220090100500838801 1 NJ#  
0120**ACKR 561838333 01FORM 1040 00001000000100100504  
#  
0120\*\*\*\*RECAP  
000000000001010080014302000000000000000001000000000000000000000001000000  
#

and everyone know xml 🙂

Is there a best practice or some best way of how it should be indexed  
in terms of "JSON format", index fields or settings? Or just throw in  
the document say with field name as "document"?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 11, 2012, 6:37am UTC](https://discuss.elastic.co/t/design-question/6342/2 "2012-01-11T06:37:42Z")

</div>

For the same use case, I use the mapper-attachment plugin.  
I send the XML file as an attachment.

HTH  
David 😉  
@dadoonet

Le 11 janv. 2012 à 02:33, Mohit Anchlia [mohitanchlia@gmail.com](mailto:mohitanchlia@gmail.com) a écrit :

> I am just starting to use elasticsearch. We have some documents in EDI  
> format and XML format that we need to index. For eg EDI format is  
> something like:
> 
> 0120**TRANA 770034661 PREPARER'S  
> AGENTE20080522010080014302AV901005 TZ #  
> 0120**TRANB 7700346616220 GREENWICH DR SAN DIEGO CA  
> 92122 8585258010 #  
> 0120**ACK 5618383330100800143020001000000000000C0004  
> 200805220090100500838801 1 NJ#  
> 0120**ACKR 561838333 01FORM 1040 00001000000100100504  
> #  
> 0120\*\*\*\*RECAP  
> 000000000001010080014302000000000000000001000000000000000000000001000000  
> #
> 
> and everyone know xml 🙂
> 
> Is there a best practice or some best way of how it should be indexed  
> in terms of "JSON format", index fields or settings? Or just throw in  
> the document say with field name as "document"?

---

<div class="post-metadata">

**Author:** ![Mohit\_Anchlia](https://avatars.discourse-cdn.com/v4/letter/m/848f3c/32.png) [@Mohit\_Anchlia](https://discuss.elastic.co/u/Mohit_Anchlia)\
**Post date:** [January 11, 2012, 4:41pm UTC](https://discuss.elastic.co/t/design-question/6342/3 "2012-01-11T16:41:28Z")

</div>

Does this plugin index the text in the document with different terms  
or it just stores as an attachment. for eg: If I wanted to say get me  
all xml documents that has value "xyz", would that be possible?

On Tue, Jan 10, 2012 at 10:37 PM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:

> For the same use case, I use the mapper-attachment plugin.  
> I send the XML file as an attachment.
> 
> HTH  
> David 😉  
> @dadoonet
> 
> Le 11 janv. 2012 à 02:33, Mohit Anchlia [mohitanchlia@gmail.com](mailto:mohitanchlia@gmail.com) a écrit :
> 
> > I am just starting to use elasticsearch. We have some documents in EDI  
> > format and XML format that we need to index. For eg EDI format is  
> > something like:
> > 
> > 0120**TRANA 770034661 PREPARER'S  
> > AGENTE20080522010080014302AV901005 TZ #  
> > 0120**TRANB 7700346616220 GREENWICH DR SAN DIEGO CA  
> > 92122 8585258010 #  
> > 0120**ACK 5618383330100800143020001000000000000C0004  
> > 200805220090100500838801 1 NJ#  
> > 0120**ACKR 561838333 01FORM 1040 00001000000100100504  
> > #  
> > 0120\*\*\*\*RECAP  
> > 000000000001010080014302000000000000000001000000000000000000000001000000  
> > #
> > 
> > and everyone know xml 🙂
> > 
> > Is there a best practice or some best way of how it should be indexed  
> > in terms of "JSON format", index fields or settings? Or just throw in  
> > the document say with field name as "document"?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 11, 2012, 5:24pm UTC](https://discuss.elastic.co/t/design-question/6342/4 "2012-01-11T17:24:55Z")

</div>

Yes, It index the content, as for pdf, ooo files and so on.

HTH  
David 😉  
@dadoonet

Le 11 janv. 2012 à 17:41, Mohit Anchlia [mohitanchlia@gmail.com](mailto:mohitanchlia@gmail.com) a écrit :

> Does this plugin index the text in the document with different terms  
> or it just stores as an attachment. for eg: If I wanted to say get me  
> all xml documents that has value "xyz", would that be possible?
> 
> On Tue, Jan 10, 2012 at 10:37 PM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:
> 
> > For the same use case, I use the mapper-attachment plugin.  
> > I send the XML file as an attachment.
> > 
> > HTH  
> > David 😉  
> > @dadoonet
> > 
> > Le 11 janv. 2012 à 02:33, Mohit Anchlia [mohitanchlia@gmail.com](mailto:mohitanchlia@gmail.com) a écrit :
> > 
> > > I am just starting to use elasticsearch. We have some documents in EDI  
> > > format and XML format that we need to index. For eg EDI format is  
> > > something like:
> > > 
> > > 0120**TRANA 770034661 PREPARER'S  
> > > AGENTE20080522010080014302AV901005 TZ #  
> > > 0120**TRANB 7700346616220 GREENWICH DR SAN DIEGO CA  
> > > 92122 8585258010 #  
> > > 0120**ACK 5618383330100800143020001000000000000C0004  
> > > 200805220090100500838801 1 NJ#  
> > > 0120**ACKR 561838333 01FORM 1040 00001000000100100504  
> > > #  
> > > 0120\*\*\*\*RECAP  
> > > 000000000001010080014302000000000000000001000000000000000000000001000000  
> > > #
> > > 
> > > and everyone know xml 🙂
> > > 
> > > Is there a best practice or some best way of how it should be indexed  
> > > in terms of "JSON format", index fields or settings? Or just throw in  
> > > the document say with field name as "document"?

---

<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:** [January 12, 2012, 10:44am UTC](https://discuss.elastic.co/t/design-question/6342/5 "2012-01-12T10:44:58Z")

</div>

I suggest just convert the XML to json, it should be simple as they are  
quite close in format.

On Wed, Jan 11, 2012 at 7:24 PM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:

> Yes, It index the content, as for pdf, ooo files and so on.
> 
> HTH  
> David 😉  
> @dadoonet
> 
> Le 11 janv. 2012 à 17:41, Mohit Anchlia [mohitanchlia@gmail.com](mailto:mohitanchlia@gmail.com) a écrit :
> 
> > Does this plugin index the text in the document with different terms  
> > or it just stores as an attachment. for eg: If I wanted to say get me  
> > all xml documents that has value "xyz", would that be possible?
> > 
> > On Tue, Jan 10, 2012 at 10:37 PM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:
> > 
> > > For the same use case, I use the mapper-attachment plugin.  
> > > I send the XML file as an attachment.
> > > 
> > > HTH  
> > > David 😉  
> > > @dadoonet
> > > 
> > > Le 11 janv. 2012 à 02:33, Mohit Anchlia [mohitanchlia@gmail.com](mailto:mohitanchlia@gmail.com) a  
> > > écrit :
> > > 
> > > > I am just starting to use elasticsearch. We have some documents in EDI  
> > > > format and XML format that we need to index. For eg EDI format is  
> > > > something like:
> > > > 
> > > > 0120**TRANA 770034661 PREPARER'S  
> > > > AGENTE20080522010080014302AV901005 TZ #  
> > > > 0120**TRANB 7700346616220 GREENWICH DR SAN DIEGO CA  
> > > > 92122 8585258010 #  
> > > > 0120**ACK 5618383330100800143020001000000000000C0004  
> > > > 200805220090100500838801 1 NJ#  
> > > > 0120**ACKR 561838333 01FORM 1040 00001000000100100504  
> > > > #  
> > > > 0120\*\*\*\*RECAP
> 
> 000000000001010080014302000000000000000001000000000000000000000001000000
> 
> > > > ```
> > > > #
> > > > 
> > > > ```
> > > > 
> > > > and everyone know xml 🙂
> > > > 
> > > > Is there a best practice or some best way of how it should be indexed  
> > > > in terms of "JSON format", index fields or settings? Or just throw in  
> > > > the document say with field name as "document"?

---

<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, 3:42am UTC](https://discuss.elastic.co/t/design-question/6342/6 "2017-07-06T03:42:57Z")

</div>


