Dear Wiki user, You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.
The following page has been changed by EricPugh: http://wiki.apache.org/solr/UpdateRichDocuments The comment on the change is: Flesh out example ------------------------------------------------------------------------------ === Example === These examples assume you have run {{{ant example}}} first and have it up and running using {{{java -jar start.jar}}}. - There is a sample PDF file at {{{src/test/test-files/simple.pdf}}} that may be used to add a PDF to the solr example server. + There is a sample Word file at {{{src/test/test-files/complex.doc}}} that may be used to add a Word document to the solr example server. - Example of using HTTP-POST to send the PDF data over the network to the Solr server: + Example of using HTTP-POST to send the PDF data over the network to the Solr server in browser: {{{ - cd src/test/test-files/ curl http://localhost:8983/solr/update/rich?stream.type=pdf --data-binary @simple.pdf -H 'Content-type:text/plain; charset=utf-8' }}} @@ -60, +59 @@ The following request will cause Solr to directly read the input file: {{{ + URL in browser to add document - curl http://localhost:8983/solr/update/rich?stream.type=pdf&stream.file=src/test/test-files/simple.pdf&id=100&stream.fieldname=name + http://localhost:8983/solr/update/rich?stream.type=doc&stream.file=src/test/test-files/complex.doc&id=101&stream.fieldname=name&commit=true #NOTE: The full path, or a path relative to the CWD of the running solr server must be used. + + URL in browser to get results + http://localhost:8983/solr/select/?q=id=101&indent=on }}} == Parameters == - Some parameters may be specified on a per field basis via {{{f.<fieldname>.param=value}}} - === fieldnames === - Specifies a comma separated list of field names to use when adding documents to the Solr index. If the CSV input already has a header, the names specified by this parameter will override them. + === stream.type === + Specifies what format the document is. It may be pdf, doc, ppt, or xls. - Example: {{{fieldnames=id,name,category}}} + Example: {{{stream.type=ppt}}} - === overwrite === - If {{{true}}} (the default), overwrite documents based on the uniqueKey field declared in the solr schema. + === stream.fieldname === + The name of the field defined in schema.xml to store the contents of the file in. + + Example: {{{stream.fieldname=text}}} + + === fieldnames === + A list of metadata fields to also index with this document. + + example: {{{fieldnames=author,subject&author=Bill&subject=fiction}}} === commit === Commit changes after all records in this request have been indexed. The default is {{{commit=false}}} to avoid the potential performance impact of frequent commits. + === overwrite === + + If {{{true}}} (the default), overwrite documents based on the uniqueKey field declared in the solr schema. + == Disadvantages == - There is no way to provide document or field index-time boosts with the CSV format, however many indicies do not utilize that feature. + There is no way to provide document or field index-time boosts, however many indicies do not utilize that feature.
