Пример #1
0
 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
 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);
   }
 }