views:

78

answers:

1

I am indexing posts in SOLR with "name", "title", and "description" fields. I'd like to later be able to add a file (like a Word doc or a PDF) using Tika / the ExtractingRequestHandler.

I know I can add documents like so: (or through other interfaces)

curl 'http://localhost:8983/solr/update/extract?literal.id=post1&commit=true' -F "[email protected]"

But this replaces the correct post (post1 above) -- is there a parameter I can pass to have it only add to the record?

+2  A: 

In Solr you can't modify fields in a document. You can only delete or add/replace whole documents. Therefore, when "appending" a file to the Solr document you have to rebuild your document from its current values (using literal), i.e. query for the document and then:

http://localhost:8983/solr/update/extract?literal.id=post1&literal.name=myName&literal.title=myTitle&literal.description=myDescription&commit=true
Mauricio Scheffer
+1 Using Solrj makes it easy to do what Mauricio describes
Pascal Dimassimo