Error when switching from embedded Solr to external Solr

As I want a persistent Solr index (due to the number of documents) locally, I am trying to switch to an externally running Solr.

However, it fails to index my documents because of this error

org.apache.solr.common.SolrException: ERROR: [doc=3b96b162-6816-4220-8e00-2ab7463403b1] Error adding field ‘Mandant.Adresse.PLZ_KEY’=‘91-218’ msg=For input string: “91-218”
at org.apache.solr.update.DocumentBuilder.toDocument(DocumentBuilder.java:260)

Caused by: java.lang.NumberFormatException: For input string: “91-218”

How can I tell A12/Solr that the fields should not be treated as a Number? It’s defined as String in the A12 data model with the annotation enable_approximate_match_search=true

Indexing this document with the embedded Solr worked without problems. What did I miss when setting up my external Solr? I started it, created the two cores that A12 needs and then started DataServices.

Hi @thomas-soft-grove,

thank you for the description. Data Services should have this covered with their schema.xml files.

Could you please verify that you use schema.xml files from [this artifact]<INTERNAL_LINK> in a version matching the data services version that you use?
The is a short related description in the Solr Server Setup paragraph.

If the setup is correct and you still have this issue, another option is to customize the ‘schema.xml’ file and add your own field for this specific field in the schema.xml, with the type ‘fulltextNGram’, for example:

<dynamicField name="*PLZ_KEY" type="fulltextNGram" indexed="true" stored="false" multiValued="true"/>

Thanks, I finally found the correct way to initialize Solr correctly.

When running sol create one has to specify the directory with all configuration files from A12, e.g.:

bin/solr create -c A12Core -d /path/to//dataservices-solr-config/src/main/resources/solr/A12Core

the same for the A12CddCore