Problem/Motivation

Due to some hard dependencies, Search API Solr 1.x should be updated to Drupal 9 so people can make an easier transition to Search API 4.x
Below is the D9 patch.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

japerry created an issue. See original summary.

japerry’s picture

Status: Active » Needs review
FileSize
14.69 KB
mkalkbrenner’s picture

Category: Task » Feature request
Priority: Critical » Normal

There's more to do in addition to this patch. Therefore I won't accept a patch that just declares compatibility and fixes the obvious findings in the code. Just to name the most important one: solarium and symfony incompatibilities regarding event dispatching.

Depending on your Solr setup you have two options for Drupal 9.

If you run Solr >=6.6 you can just upgrade to Search APi Solr 4.x following https://www.drupal.org/docs/8/modules/search-api-solr/search-api-solr-ho...

If you run Solr < 6.6 you need to additionally activate the seach_api_solr_legacy module which is part of Search APi Solr.

japerry’s picture

So TL;dr its for acquia search ;) And its current offering (3.5/4.5) is going to be around for a while. More importantly, the legacy module won't work because it requires a manual redeploy of the solrconfig for every customer upgrading to 4.x. That is not really desirable from a support perspective.

Thanks for the suggestion about Solarium, but there is no incompatibility with D9; At least from small amount of testing that I've done, with 3.x-dev, Drupal 9, and some test content (umami) with Acquia Search/Connector. The latest release is incompatible, but head of Solarium 3.x works just fine. It'd be nice if a tag for the latest code out of the 3.x branch was rolled.

This patch fixes one thing Drupal rector didn't find, but was caught when I tried to load the site status page. It also bumps the solarium requirement

ben.hamelin’s picture

Just following here, same boat. Acquia hosted site being built in D9.

mkalkbrenner’s picture

Status: Needs review » Needs work

I understand that there's a wish to add support for Drupal 9 to 8.x-1.x.

But beside other organizational tasks, some more things are required to consider this patch to be committed:

  1. The code should be ported to solarium 6. Search API Solr Legacy proves that it could be done. Otherwise we might run into problems with PHP 7.4 or symfony I don't want to maintain.
  2. The tests need to be migrated from travis to github actions. Again, Search API Solr Legacy is the blue print for it.
  3. A decision for search_api_solr_multilingual needs to be taken
mkalkbrenner’s picture

I migrated the 8.x-1.x from travis to github actions:
https://github.com/mkalkbrenner/search_api_solr/actions

Currently the tests are using PHP 7.3 and pass. PHP 7.4 will immediately lead to errors because of solarium 3.

@japerry you can now start creating PRs on github for your patches, namely the port to solarium 6 and Drupal 9.

BTW the small adjustments to the Solr configs will not affect existing indexes!

mkalkbrenner’s picture

Status: Needs work » Needs review

  • mkalkbrenner committed b012d30 on 8.x-1.x
    Issue #3181155 by japerry, mkalkbrenner: Drupal 9 compatibility for 8.x-...
  • mkalkbrenner committed dc90489 on 8.x-1.x
    Issue #3181155 by japerry, mkalkbrenner: Drupal 9 compatibility for 8.x-...
mkalkbrenner’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

gxleano made their first commit to this issue’s fork.