Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Schema is not created or updated [DATASOLR-322] #449

Open
spring-projects-issues opened this issue Aug 6, 2016 · 1 comment
Open

Schema is not created or updated [DATASOLR-322] #449

spring-projects-issues opened this issue Aug 6, 2016 · 1 comment
Assignees
Labels
type: bug

Comments

@spring-projects-issues
Copy link

@spring-projects-issues spring-projects-issues commented Aug 6, 2016

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 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)

@Nunien
Copy link

@Nunien Nunien commented Sep 20, 2021

When I set schemaCreationSupport to true along with the above public SolrTemplate solrTemplate(SolrClient solrClient) implementation, I get java.lang.UnsupportedOperationException: The solr rest API does not allow schema creation..
Comes from https://github.com/spring-projects/spring-data-solr/blob/main/src/main/java/org/springframework/data/solr/core/schema/SolrSchemaWriter.java line 50

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug
Projects
None yet
Development

No branches or pull requests

3 participants