The code using SolrJ, listed below, was running on the same machine as Solr.
public static void IndexBeanValues(ListtestRecords) throws IOException, SolrServerException { HttpSolrServer server = new HttpSolrServer("http://localhost:8983/solr"); server.addBeans(testRecords); server.commit(); }
I tried passing in an instance to SolrServer, but it didn't make any noticeable difference for timing. It might make more of a difference instantiating a new instance of SolrServer for each batch if the Java code using SolrJ is running on a different machine than the Solr server being targeted.
Refer to this post for a more detailed code example using SolrJ and addBeans.
Refer to this post for a more detailed code example using SolrJ and addBeans.
No comments:
Post a Comment