Reputation: 205
I can add field like this in Java
, but I want to add pdf document to Solr
with SolrJ in Java
, how can I add a pdf file?
CommonsHttpSolrServer server = new CommonsHttpSolrServer("http://localhost:8983/solr");
SolrInputDocument doc = new SolrInputDocument();
doc.addField("cat", "lalal");
doc.addField("id", "1");
server.add(doc);
server.commit();
Upvotes: 0
Views: 2873
Reputation: 27614
Solr uses Apache Tika to process binary files.
See http://wiki.apache.org/solr/ExtractingRequestHandler and http://wiki.apache.org/solr/ContentStreamUpdateRequestExample for a SolrJ example.
Upvotes: 3