List of usage examples for org.springframework.data.solr.core.schema SchemaDefinition getCollectionName
@Nullable
public String getCollectionName()
From source file:org.springframework.data.solr.core.schema.SolrSchemaWriter.java
public void writeSchema(SchemaDefinition schemaDefinition) { if (isSchemaPresent(schemaDefinition.getCollectionName())) { updateSchema(schemaDefinition);/* w w w .j a va 2s. co m*/ return; } createSchema(schemaDefinition); }
From source file:org.springframework.data.solr.core.schema.SolrSchemaWriter.java
protected void updateSchema(SchemaDefinition schemaDefinition) { SchemaDefinition existing = loadExistingSchema(schemaDefinition.getCollectionName()); List<FieldDefinition> fieldsToBeCreated = new ArrayList<FieldDefinition>(); for (FieldDefinition fieldDefinition : schemaDefinition.getFields()) { if (!existing.containsField(fieldDefinition.getName())) { fieldsToBeCreated.add(fieldDefinition); }/*from w ww . ja v a 2 s . c o m*/ } writeFieldDefinitions(fieldsToBeCreated, schemaDefinition.getCollectionName()); }