Setting schemaCreationSupport to true in @EnableSolrRepositories annotation doesn't seem to trigger schema creation.
From what I found out it looks like SolrRepositoryFactory#addSchemaCreationFeaturesIfEnabled is called before schemaCreationSupport field is set to true, which results in empty schemaCreationFeatures of SolrTemplate.
If I set these features manually, schema creation works as expected.
@Bean
public SolrTemplate solrTemplate(SolrClient solrClient) {
SolrTemplate template = new SolrTemplate(solrClient);
template.setSchemaCreationFeatures(Collections.singletonList(SolrPersistentEntitySchemaCreator.Feature.CREATE_MISSING_FIELDS));
return template;
}
Affects: 2.0.2 (Hopper SR2)
The text was updated successfully, but these errors were encountered:
Tomasz Wójcik opened DATASOLR-322 and commented
Setting
schemaCreationSupport
to true in@EnableSolrRepositories
annotation doesn't seem to trigger schema creation.From what I found out it looks like
SolrRepositoryFactory#addSchemaCreationFeaturesIfEnabled
is called beforeschemaCreationSupport
field is set totrue
, which results in emptyschemaCreationFeatures
ofSolrTemplate
.If I set these features manually, schema creation works as expected.
Affects: 2.0.2 (Hopper SR2)
The text was updated successfully, but these errors were encountered: