List of usage examples for org.apache.solr.core SolrCore setLatestSchema
public void setLatestSchema(IndexSchema replacementSchema)
From source file:com.searchbox.engine.solr.EmbeddedSolr.java
License:Apache License
private boolean addCopyFields(Collection collection, Field field, Set<String> copyFields) { SolrCore core = coreContainer.getCore(collection.getName()); IndexSchema schema = core.getLatestSchema(); for (CopyField copyField : schema.getCopyFieldsList(field.getKey())) { copyFields.remove(copyField.getDestination().getName()); }/* w w w . j av a 2 s .com*/ Map<String, java.util.Collection<String>> copyFieldsMap = new HashMap<String, java.util.Collection<String>>(); copyFieldsMap.put(field.getKey(), copyFields); schema = schema.addCopyFields(copyFieldsMap); core.setLatestSchema(schema); return true; }