SolrJ

使用SolrJ:

 

UpdateRequest req = new UpdateRequest();
req.setAction(UpdateRequest.ACTION.COMMIT, false, false);
req.setParam(UpdateParams.COLLECTION, "targetCollectionName");
req.add(getSolrServer().getBinder().toSolrInputDocument(new Object()));
req.process(getSolrServer());

 

getSolrServer().add(updateDoc);
getSolrServer().addBean(updateDoc);
getSolrServer().commit();

 

你可能感兴趣的:(solrj)