private void addCopyFieldToSchema(String source, String dest, SolrClient solrClient) throws IOException { try { List<String> copyFieldAttributes = new ArrayList<String>(); copyFieldAttributes.add(dest); SchemaRequest.DeleteCopyField deleteCopyField = new SchemaRequest.DeleteCopyField(source, copyFieldAttributes); SchemaResponse.UpdateResponse deleteCopyFieldRes = deleteCopyField.process(solrClient); SchemaRequest.AddCopyField schemaCopyRequest = new SchemaRequest.AddCopyField(source, copyFieldAttributes); SchemaResponse.UpdateResponse copyFieldResponse = schemaCopyRequest.process(solrClient); } catch (SolrServerException e) { LOG.error("Error while adding copyfields to the solrclient.", e); e.printStackTrace(); } }
public Update buildCreate() { return new AddCopyField(source, destinations); }
private void addCopyFieldToSchema(String source, String dest, SolrClient solrClient) throws IOException { try { List<String> copyFieldAttributes = new ArrayList<String>(); copyFieldAttributes.add(dest); SchemaRequest.DeleteCopyField deleteCopyField = new SchemaRequest.DeleteCopyField(source, copyFieldAttributes); SchemaResponse.UpdateResponse deleteCopyFieldRes = deleteCopyField.process(solrClient); SchemaRequest.AddCopyField schemaCopyRequest = new SchemaRequest.AddCopyField(source, copyFieldAttributes); SchemaResponse.UpdateResponse copyFieldResponse = schemaCopyRequest.process(solrClient); } catch (SolrServerException e) { LOG.error("Error while adding copyfields to the solrclient.", e); e.printStackTrace(); } }
public AddCopyField(String source, List<String> dest, SolrParams q) { super(createRequestParameters(source, dest, null), q); }
public AddCopyField(String source, List<String> dest, SolrParams q) { super(createRequestParameters(source, dest, null), q); }
public AddCopyField(String source, List<String> dest, Integer maxChars, SolrParams q) { super(createRequestParameters(source, dest, maxChars), q); }
public AddCopyField(String source, List<String> dest, Integer maxChars, SolrParams q) { super(createRequestParameters(source, dest, maxChars), q); }
private void addCopyField(final CopyFieldDefinition field) { template.execute(solrClient -> { UpdateResponse response = new SchemaRequest.AddCopyField(field.getSource(), field.getDestination()) .process(solrClient, collection); if (hasErrors(response)) { throw new SchemaModificationException(String.format( "Adding copy field %s with destinations %s to collection %s failed with status %s. Server returned %s.", field.getSource(), field.getDestination(), collection, response.getStatus(), response)); } return Integer.valueOf(response.getStatus()); }); }