private void index(boolean isSolrCloud, String collection, Long commitWithin, String contentStreamPath, MultiMapSolrParams requestParams, List<SolrInputDocument> inputDocumentList) throws IOException, SolrServerException,SolrException { UpdateRequest request = new UpdateRequest(contentStreamPath); request.setParams(new ModifiableSolrParams()); // add the extra params, don't use 'set' in case of repeating params Iterator<String> paramNames = requestParams.getParameterNamesIterator(); while (paramNames.hasNext()) { String paramName = paramNames.next(); for (String paramValue : requestParams.getParams(paramName)) { request.getParams().add(paramName, paramValue); } } // specify the collection for SolrCloud if (isSolrCloud) { request.setParam(COLLECTION_PARAM_NAME, collection); } if (commitWithin != null && commitWithin > 0) { request.setParam(COMMIT_WITHIN_PARAM_NAME, commitWithin.toString()); } // if a username and password were provided then pass them for basic auth if (isBasicAuthEnabled()) { request.setBasicAuthCredentials(getUsername(), getPassword()); } request.add(inputDocumentList); UpdateResponse response = request.process(getSolrClient()); getLogger().debug("Got {} response from Solr", new Object[]{response.getStatus()}); inputDocumentList.clear(); }
public void document(SolrInputDocument document, UpdateRequest updateRequest) { if (addCmd == null) { addCmd = getAddCommand(updateRequest.getParams()); } addCmd.solrDoc = document; try { processor.processAdd(addCmd); addCmd.clear(); } catch (IOException e) { throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "ERROR adding document " + document); } } });
SolrParams params = req.getParams(); if( params != null ) { String fmt = null;
while (upd != null) { UpdateRequest req = upd.getRequest(); SolrParams currentParams = new ModifiableSolrParams(req.getParams()); if (!origParams.toNamedList().equals(currentParams.toNamedList()) || !StringUtils.equals(origTargetCollection, upd.getCollection())) { if (isXml) { SolrParams params = req.getParams(); if (params != null) { String fmt = null;
SolrParams params = req.getParams(); if( params != null ) {
final boolean isXml = ClientUtils.TEXT_XML.equals(contentType); final ModifiableSolrParams origParams = new ModifiableSolrParams(updateRequest.getParams());
SolrParams params = req.getParams(); if (params != null) {
final boolean isXml = ClientUtils.TEXT_XML.equals(contentType); final ModifiableSolrParams origParams = new ModifiableSolrParams(update.getRequest().getParams()); final String origTargetCollection = update.getCollection();
SolrParams params = req.getParams(); if (params != null) {
if(updateRequest.getParams()==null) { NamedList params = (NamedList) namedList[0].get("params"); if(params!=null) {
private void index(boolean isSolrCloud, String collection, Long commitWithin, String contentStreamPath, MultiMapSolrParams requestParams, List<SolrInputDocument> inputDocumentList) throws IOException, SolrServerException,SolrException { UpdateRequest request = new UpdateRequest(contentStreamPath); request.setParams(new ModifiableSolrParams()); // add the extra params, don't use 'set' in case of repeating params Iterator<String> paramNames = requestParams.getParameterNamesIterator(); while (paramNames.hasNext()) { String paramName = paramNames.next(); for (String paramValue : requestParams.getParams(paramName)) { request.getParams().add(paramName, paramValue); } } // specify the collection for SolrCloud if (isSolrCloud) { request.setParam(COLLECTION_PARAM_NAME, collection); } if (commitWithin != null && commitWithin > 0) { request.setParam(COMMIT_WITHIN_PARAM_NAME, commitWithin.toString()); } // if a username and password were provided then pass them for basic auth if (isBasicAuthEnabled()) { request.setBasicAuthCredentials(getUsername(), getPassword()); } request.add(inputDocumentList); UpdateResponse response = request.process(getSolrClient()); getLogger().debug("Got {} response from Solr", new Object[]{response.getStatus()}); inputDocumentList.clear(); }
if(updateRequest.getParams()==null) { NamedList params = (NamedList) namedList[0].get("params"); if(params!=null) {
NamedList params = solrParamsToNamedList(updateRequest.getParams()); if (updateRequest.getCommitWithin() != -1) { params.add("commitWithin", updateRequest.getCommitWithin());
NamedList params = solrParamsToNamedList(updateRequest.getParams()); if (updateRequest.getCommitWithin() != -1) { params.add("commitWithin", updateRequest.getCommitWithin());
NamedList params = solrParamsToNamedList(updateRequest.getParams()); if (updateRequest.getCommitWithin() != -1) { params.add("commitWithin", updateRequest.getCommitWithin());