Hi,
Struggling to Import an XML containing an XSL transformation from
dataImport.
Do we need to run in Cloud mode for this ?
When I start solr in DIH mode, my other Cores are not visible.
1) My SolrConfig.XML has this:
  <requestHandler name="/dataimport" class="solr.DataImportHandler">
    <lst name="defaults">
      <!--str name="config">solr-data-config.xml</str-->
  <str name="config">rahul-data-config.xml</str>
    </lst>
  </requestHandler>
2) My rahul-data-config.xml looks like this:
<dataConfig>
    <dataSource type="URLDataSource" />
    <document>
<entity name="page"
pk="id"
useSolrAddSchema="true"
                processor="XPathEntityProcessor"
                stream="true"
foreach="/"
                url="http://localhost/xml/1998.1.651698.xml";
                transformer="RegexTransformer,DateFormatTransformer"
        >
</entity>
</document>
</dataConfig>
3) My XML looks like this:
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" version="2.0" href="updateXML.xsl"?>
<bulletin type="si">
  <header>
    <group-description>Audio, Navigation, Monitors, Alarms,
SRS</group-description>
    <bulletin-number> B 65 16 98</bulletin-number>
    <department>Service Engineering</department>
    <date>
      <month>February</month>
      <year>1999</year>
    </date>
  </header>
</bulletin>
4) My XSL looks like this:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl='
http://www.w3.org/1999/XSL/Transform'>

<xsl:template match='/'>
<add>
<xsl:for-each select="bulletin/header">
<doc>
        <field name="bulletin-number"><xsl:value-of
select="bulletin-number"/></field>
        <field name="department"><xsl:value-of select="department"/></field>
</doc>
</xsl:for-each>
</add>
</xsl:template>
</xsl:stylesheet>

I am hosting the XML and XSL on XAMPP (Apache) server.
5) My debug response from dataimport looks like this:
{
  "responseHeader": {
    "status": 0,
    "QTime": 54
  },
  "initArgs": [
    "defaults",
    [
      "config",
      "rahul-data-config.xml"
    ]
  ],
  "command": "full-import",
  "mode": "debug",
  "documents": [],
  "verbose-output": [],
  "status": "idle",
  "importResponse": "",
  "statusMessages": {
    "Total Requests made to DataSource": "1",
    "Total Rows Fetched": "0",
    "Total Documents Processed": "0",
    "Total Documents Skipped": "0",
    "Full Dump Started": "2018-01-31 04:35:02",
    "": "Indexing completed. Added/Updated: 0 documents. Deleted 0
documents.",
    "Committed": "2018-01-31 04:35:02",
    "Time taken": "0:0:0.33"
  }
}

Please note that documents is an empty array.

What am I doing wrong ?

Best Regards,
Rahul.

Reply via email to