コード例 #1
0
ファイル: SolrDocWriter.java プロジェクト: nddipiazza/lux
 private void deleteCloud(DeleteUpdateCommand cmd) throws IOException {
   UpdateRequestProcessorChain updateChain =
       xqueryComponent.getCore().getUpdateProcessingChain("lux-update-chain");
   SolrQueryResponse rsp = new SolrQueryResponse();
   SolrQueryRequest req = UpdateDocCommand.makeSolrRequest(core);
   UpdateRequestProcessor processor = updateChain.createProcessor(req, rsp);
   processor.processDelete(cmd);
   processor.finish();
 }
コード例 #2
0
ファイル: SolrDocWriter.java プロジェクト: nddipiazza/lux
 private void writeToCloud(SolrInputDocument solrDoc, String uri) {
   ArrayList<String> urls = xqueryComponent.getShardURLs(true);
   LoggerFactory.getLogger(getClass()).debug("writing " + uri + " to cloud at " + urls);
   SolrQueryResponse rsp = new SolrQueryResponse();
   SolrQueryRequest req = UpdateDocCommand.makeSolrRequest(core);
   ((ModifiableSolrParams) req.getParams())
       .add(ShardParams.SHARDS, urls.toArray(new String[urls.size()]));
   UpdateRequest updateReq = new UpdateRequest();
   updateReq.add(solrDoc);
   UpdateDocCommand cmd = new UpdateDocCommand(req, solrDoc, null, uri);
   UpdateRequestProcessorChain updateChain =
       xqueryComponent.getCore().getUpdateProcessingChain("lux-update-chain");
   try {
     UpdateRequestProcessor processor = updateChain.createProcessor(req, rsp);
     processor.processAdd(cmd);
     processor.finish();
   } catch (IOException e) {
     throw new LuxException(e);
   }
 }