We import an XML file directly to SOLR using a the script called post.sh in
the exampledocs. This is the script:

FILES=$*
URL=http://localhost:8983/solr/update

for f in $FILES; do
  echo Posting file $f to $URL
  curl $URL --data-binary @$f -H 'Content-type:text/xml; charset=utf-8'
  echo
done

#send the commit command to make sure all the changes are flushed and
visible
curl $URL --data-binary '<commit/>' -H 'Content-type:text/xml;
charset=utf-8'
echo

Our XML file looks something like this:

<add>
  <doc>
    <field name="ProductGuid">D22BF0B9-EE3A-49AC-A4D6-000B07CDA18A</field>
    <field name="SkuGuid">D22BF0B9-EE3A-49AC-A4D6-000B07CDA18A</field>
    <field name="ProductGroupId">1000</field>
    <field name="VendorSkuCode">CK4475</field>
    <field name="VendorSkuAltCode">CK4475</field>
    <field name="ManufacturerSkuCode">NULL</field>
    <field name="ManufacturerSkuAltCode">NULL</field>
    <field name="UpcEanSkuCode">840655037330</field>
    <field name="VendorSupersededSkuCode">NULL</field>
    <field name="VendorProductDescription">EBC CLUTCH KIT</field>
    <field name="VendorSkuDescription">EBC CLUTCH KIT</field>
  </doc>
</add>

How can I tell solr that the "NULL" value should be treated as null?

Thanks,
Randolf 

--
View this message in context: 
http://lucene.472066.n3.nabble.com/Import-null-values-from-XML-file-tp3905600p3905600.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to