0

I am using spring-data-solr 2.0.5.RELEASE with solr server 5.5.3

I have a field defined as follows

public class Org {
  ...
  @Indexed(name = "geoLocation", type = "location")
  private Point geoLocation;
  ...
}

When I run a test that uses the class, this field is created in Solr as "Field-Type:org.apache.solr.schema.StrField"

I have tried setting type="point" as well as not setting it. In all cases, the field gets created as StrField in Solr.

Does spring-data-solr create Solr schema based on the datatype of the Java field (in this case a Point field) or using the type attribute in the @Indexed annotation?

If yes, what is missed in this example?

Ram
  • 11
  • 5
  • do you have the schema support enabled? `@EnableSolrRepositories(schemaCreationSupport = true, multicoreSupport = true)` – Christoph Strobl Dec 20 '16 at 13:16
  • I tried your suggestion and it still doesnt create it as correct datatype. – Ram Dec 22 '16 at 04:12
  • I referred to https://github.com/spring-projects/spring-data-solr#automatic-schema-population which said solr has to be in schemaless mode. Checked that it was. Also, the schema is getting updated for missing columns, just that the datatype is not correct and gets created as StrField http://stackoverflow.com/questions/39791966/enable-schemacreationsupport-in-spring-boot-starter-data-solr seems to indicate that it is a problem that is not fixed yet. – Ram Dec 22 '16 at 04:16

0 Answers0