|
| 1 | +# Solr 9 Config Notes |
| 2 | + |
| 3 | +**Directory:** `docker/solr_configs/9.x.x` |
| 4 | + |
| 5 | +This directory contains Solr configuration files customized specifically for |
| 6 | +**pysolr test requirements**. |
| 7 | + |
| 8 | +These files are based on Solr 9 defaults, with a small number of intentional |
| 9 | +changes. If this configuration needs to be updated for a future Solr version |
| 10 | +(e.g. Solr 10), please make sure the customizations documented below are |
| 11 | +preserved. |
| 12 | + |
| 13 | +--- |
| 14 | + |
| 15 | +## schema.xml |
| 16 | + |
| 17 | +We do **not** maintain a separate `schema.xml` file here. |
| 18 | + |
| 19 | +Originally, `schema.xml` was just a renamed copy of Solr’s default |
| 20 | +`managed-schema.xml`. |
| 21 | + |
| 22 | +Instead of duplicating it, the Docker/compose scripts now **rename** |
| 23 | +`<CORE>/conf/managed-schema.xml` to `<CORE>/conf/schema.xml` before Solr starts. |
| 24 | + |
| 25 | +This avoids maintaining two equivalent schema files and keeps the source of |
| 26 | +truth aligned with upstream Solr defaults. |
| 27 | + |
| 28 | +--- |
| 29 | + |
| 30 | +## solrconfig.xml |
| 31 | + |
| 32 | +There are **two intentional changes** compared to the default Solr configuration: |
| 33 | + |
| 34 | +### 1. ClassicIndexSchemaFactory |
| 35 | + |
| 36 | +```xml |
| 37 | +<schemaFactory class="ClassicIndexSchemaFactory" /> |
| 38 | +``` |
| 39 | + |
| 40 | +This tells Solr to use `schema.xml` instead of `managed-schema.xml`. |
| 41 | +Using `schema.xml` is preferred because it is **immutable at runtime**. |
| 42 | + |
| 43 | +**Source location:** |
| 44 | +[ClassicIndexSchemaFactory configuration](https://github.com/django-haystack/pysolr/blob/fa3457b4b3de44c053128052c9dc61282a2f9021/docker/solr_configs/9.x.x/solrconfig.xml#L37) |
| 45 | + |
| 46 | +**Solr documentation:** |
| 47 | +[Solr 9 Schema Factories – ClassicIndexSchemaFactory](https://solr.apache.org/guide/solr/9_9/configuration-guide/schema-factory.html#schema-factories) |
| 48 | + |
| 49 | +--- |
| 50 | + |
| 51 | +### 2. MoreLikeThis request handler |
| 52 | + |
| 53 | +```xml |
| 54 | +<requestHandler name="/mlt" class="solr.MoreLikeThisHandler" /> |
| 55 | +``` |
| 56 | + |
| 57 | +This request handler is **not enabled by default** in Solr, but several pysolr |
| 58 | +test cases depend on it. |
| 59 | + |
| 60 | +**Source location:** |
| 61 | +[MoreLikeThis request handler configuration](https://github.com/django-haystack/pysolr/blob/fa3457b4b3de44c053128052c9dc61282a2f9021/docker/solr_configs/9.x.x/solrconfig.xml#L615) |
| 62 | + |
| 63 | +**Solr documentation:** |
| 64 | +[Solr 9 MoreLikeThis query handler](https://solr.apache.org/guide/solr/9_9/query-guide/morelikethis.html) |
| 65 | + |
| 66 | +--- |
| 67 | + |
| 68 | +## Notes for Future Solr Versions |
| 69 | + |
| 70 | +When upgrading to a new Solr major version (e.g. Solr 10): |
| 71 | + |
| 72 | +- Create a new versioned directory, e.g. `docker/solr_configs/10.x.x` |
| 73 | +- Start from the **upstream default `solrconfig.xml`** for that Solr version |
| 74 | +- Re-apply the two changes documented above |
| 75 | +- Keep schema handling via `schema.xml` + `ClassicIndexSchemaFactory` |
| 76 | +- Ensure the `/mlt` request handler remains enabled |
| 77 | + |
| 78 | +This README exists to avoid losing these details during future upgrades. |
0 commit comments