Import null values from XML file

2012-04-12 Thread randolf.julian
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=ProductGuidD22BF0B9-EE3A-49AC-A4D6-000B07CDA18A/field
field name=SkuGuidD22BF0B9-EE3A-49AC-A4D6-000B07CDA18A/field
field name=ProductGroupId1000/field
field name=VendorSkuCodeCK4475/field
field name=VendorSkuAltCodeCK4475/field
field name=ManufacturerSkuCodeNULL/field
field name=ManufacturerSkuAltCodeNULL/field
field name=UpcEanSkuCode840655037330/field
field name=VendorSupersededSkuCodeNULL/field
field name=VendorProductDescriptionEBC CLUTCH KIT/field
field name=VendorSkuDescriptionEBC 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.


Re: Import null values from XML file

2012-04-12 Thread Erick Erickson
What does treated as null mean? Deleted from the doc?
The problem here is that null-ness is kind of tricky. What
behaviors do you want out of Solr in the NULL case?

You can drop this out of the document by writing a custom
updateHandler. It's actually quite simple to do.

Best
Erick

On Thu, Apr 12, 2012 at 9:14 AM, randolf.julian
randolf.jul...@dominionenterprises.com wrote:
 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=ProductGuidD22BF0B9-EE3A-49AC-A4D6-000B07CDA18A/field
    field name=SkuGuidD22BF0B9-EE3A-49AC-A4D6-000B07CDA18A/field
    field name=ProductGroupId1000/field
    field name=VendorSkuCodeCK4475/field
    field name=VendorSkuAltCodeCK4475/field
    field name=ManufacturerSkuCodeNULL/field
    field name=ManufacturerSkuAltCodeNULL/field
    field name=UpcEanSkuCode840655037330/field
    field name=VendorSupersededSkuCodeNULL/field
    field name=VendorProductDescriptionEBC CLUTCH KIT/field
    field name=VendorSkuDescriptionEBC 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.