<lib/> directives have been made into an "opt-in" feature in Solr 9.8

Created on 11 February 2025, about 2 months ago

Setup

  • Solr version: 9.8
  • Drupal Core version: 10.4.2
  • Search API version: 1.37.0
  • Search API Solr version: 4.3.7
  • Configured Solr Connector: basic_auth

Issue

Solr 9.8 introduced a braking change: <lib/> directives in solrconfig.xml have been made into an "opt-in" feature. This can cause Solr to fail if not addressed on Solr instance, as the solrconfig.xml provided by this module both contains and relies on <lib/> directives.

Solr 10 plans to remove the <lib/>-directive entirely:

<lib/> directives are deprecated and will be removed in Solr 10.0. In the interim, Solr disables this feature by default in order to minimize the security exposure of our users. Expert users who wish to enable <lib/> directives in their deployment may do so by specifying setting the solr.config.lib.enabled sysprop to true.

Solr will produce both a silent warning:

Configset references one or more <lib/> directives, but <lib/> usage is disabled on this Solr node. Either remove all <lib/> tags from the relevant configset, or enable use of this feature by setting 'solr.config.lib.enabled=true'

and, if not mitigated, a error:

Can't load schema /var/solr/data/defaultcore/conf/schema.xml: Plugin init failure for [schema.xml] fieldType "collated_de": Error loading class 'solr.ICUCollationField'

Possible solutions

As solutions must be implemented on the Solr-Instance itself, there is not much this project can do other than inform Users about these changes and suggest possible solutions. Possible solutions are:

  • Setting solr.config.lib.enabled=true, as suggested by Solr's error messages. This can be achieved, for example, by setting SOLR_OPTS="$SOLR_OPTS -Dsolr.config.lib.enabled=true" in
  • Installing the required modules globally. In a container for example, setting the environment variable SOLR_MODULES=extraction,langid,ltr,analysis-extras will work.


  • Im not sure myself what the best way to do this is, and under what circumstances adding solr.config.lib.enabled=true is a good idea, so I would appreciate feedback on this before writing stuff in the documentation.

    Further Resources:

    πŸ› Bug report
    Status

    Active

    Version

    4.3

    Component

    Documentation

    Created by

    πŸ‡©πŸ‡ͺGermany RobinCS

    Live updates comments and jobs are added and updated live.
    Sign in to follow issues

    Comments & Activities

    Production build 0.71.5 2024