0

I have almost 250 XML data files (one file contain 1000 pairs of xml formatted data) and i have one elasticsearch server. My application build on Ruby on Rails platform. I know how to do index on Model in rails application (ModelName.import) which will do indexes on elasticsearch server.

But is there other way that we can directly do indexing using XML data files on elasticsearch server instead of using .import method?

XML file looks like (XML file may contain 1000 item per file),

<?xml version="1.0" encoding="UTF-8"?>
<catalog items="2" total-pages="260" page="1" per-page="2" status="complete">
<item>
<sku>1</sku>
<vbid>1</vbid>
<created>Sun, 05 Oct 2014 03:35:58 +0000</created>
<updated>Sun, 06 Mar 2016 12:44:48 +0000</updated>
<subjects>
  <subject schema="bisac" code="HIS027090">World War I</subject>
  <subject schema="coursesmart" code="cs.soc_sci.hist.milit_hist">Social Sciences -&gt; History -&gt; Military History</subject>
</subjects>
<aliases>
  <eisbn-canonical>1</eisbn-canonical>
  <isbn-canonical>1</isbn-canonical>
  <print-isbn-canonical>9780752460864</print-isbn-canonical>
  <fpid/>
  <isbn13>1</isbn13>
  <isbn10>0750951796</isbn10>
  <additional-isbns>
    <isbn type="print-isbn-10">0752460862</isbn>
    <isbn type="print-isbn-13">9780752460864</isbn>
  </additional-isbns>
</aliases>
</item>
<item>
<sku>2</sku>
<vbid>2</vbid>
<created>Sun, 05 Oct 2014 03:35:58 +0000</created>
<updated>Sun, 06 Mar 2016 12:44:48 +0000</updated>
<subjects>
  <subject schema="bisac" code="HIS027090">World War I</subject>
  <subject schema="coursesmart" code="cs.soc_sci.hist.milit_hist">Social Sciences -&gt; History -&gt; Military History</subject>
</subjects>
<aliases>
  <eisbn-canonical>2</eisbn-canonical>
  <isbn-canonical>2</isbn-canonical>
  <print-isbn-canonical>9780752460864</print-isbn-canonical>
  <fpid/>
  <isbn13>2</isbn13>
  <isbn10>0750951796</isbn10>
  <additional-isbns>
    <isbn type="print-isbn-10">0752460862</isbn>
    <isbn type="print-isbn-13">9780752460864</isbn>
  </additional-isbns>
</aliases>
</item>
</catalog>
3
  • This might be helpful: stackoverflow.com/questions/29433708/… Commented Apr 21, 2016 at 6:23
  • How does your XML data look like? Are the tags or attributes important? Commented Apr 21, 2016 at 6:33
  • @Aetherus I have added XML file and yes all tags and attributes are important Commented Apr 21, 2016 at 6:45

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.