ddev / ddev-solr

Solr service for DDEV
Apache License 2.0
4 stars 5 forks source link

Config reset on every restart? #35

Closed ChristianAdamski closed 1 month ago

ChristianAdamski commented 1 month ago

Simple observation with ddev & Search API Solr.

Everytime I restart it says on /admin/config/search/search-api/server/[my-server]:

Error message You are using an incompatible Solr schema. Please follow the instructions described in the README.md file for setting up Solr.

Then I do:

ddev drush solr-upload-conf [my-server]

and its fine. Until restarting ddev.

Any ideas? Did nothing to the config files at .ddev/solr directory, all pretty fresh install.

mkalkbrenner commented 1 month ago

That's strange. Meanwhile 0.4.0 has been tested by different people with and without search_api_solr. What is the name of the collection?

mkalkbrenner commented 1 month ago

Maybe you should delete the solr docker volume once. Is there still a zookeeper container running? It should be gone with 0.4.0

ChristianAdamski commented 1 month ago

grafik

grafik

After restart / before uploading config grafik

ChristianAdamski commented 1 month ago

After uploading config (via drush)

grafik

ChristianAdamski commented 1 month ago

There is no data loss. And the drush command is simple enough, so this not particular cumbersome. It was just highly frustrating until I figured out what's happening.

mkalkbrenner commented 1 month ago

techproducts is the example collection included in the Solr distribution and gets resettet to its own schema on every start. You must create your own collection in drupal, using a different name, not techproducts.

The techproducts example uses a totally different schema which is not a drupal-compatible schema.

BTW We were of the opinion that having this example collection is better than nothing. I just removed the example to avoid confusion: https://github.com/ddev/ddev-solr/pull/36

ChristianAdamski commented 1 month ago

First, thanks for the response. I now remove "techproducts" collection and instead added my own "geotest". I'm the maintainer of "geolocation" module on d.o and tested Spatial stuff. This is relevant because:

The spatial context JTS was not working before, it was after the change, also allowing for indexing of polygons. Thats good.

However: after "ddev restart", collection "techproducts" reappeared and my collection "geotest" is completly broken and test data unavailable,

mkalkbrenner commented 1 month ago

delete the solr docker volume or run ddev delete

ChristianAdamski commented 1 month ago

Started from scratch, removed images, container, volumes. Created a new collection in the solr admin. Connected in search api and tried to upload new configset. Also tried with drush. Browser & drush says "Success", but no change.

See image: grafik

mkalkbrenner commented 1 month ago

I can't believe that this should be fresh installation. Previously you used the techproducts configset, now you use the _default configset which is built-in in Solr. Both have nothing to do with drupal. Drupal should create a configset using the name of the search_api server.

mkalkbrenner commented 1 month ago

OK, if the collection already exists, "upload configset" re-uses the name of the configset. You should not create the collection manually! Delete all collections and let drupal create it. (like described in Search API Solr's README.)

ChristianAdamski commented 1 month ago

Ok, I let Search API create the collection, that worked, and it now also "survives" a restart.

So, my mistakes:

1.) Going by the README.MD "Default Solr collection: techproducts" I used that, and it was constantly reseting. 2.) Going by the Server "collection" field description, I created my "own" collection:

The name that identifies the Solr default collection to use. The concrete collection to use could be overwritten per index. The most common use-case is to leverage this default collection. Only sophisticated multi-site setups or foreign indexes accessed via Solr Document Datasources or specific requirements of your Solr hosting provider might require to leave this field empty. Because of that, the field is not marked as required as it should be for most use-cases.

ChristianAdamski commented 1 month ago

So, this can be closed. Thanks!

Separately I am struggling with WKT / JTS, but that would be a separate issue.