Skip to content

[SITE-5456] Add support for Solr 9 in D7#223

Open
rkunjappan wants to merge 2 commits intodefaultfrom
SITE-5456-solr9
Open

[SITE-5456] Add support for Solr 9 in D7#223
rkunjappan wants to merge 2 commits intodefaultfrom
SITE-5456-solr9

Conversation

@rkunjappan
Copy link
Copy Markdown

@rkunjappan rkunjappan commented Apr 23, 2026

Summary

Adds Solr 9 support for Drupal 7 on Pantheon. Built on top of Promet's Solr 8 work (PR #221), adapted for Solr 9, and integrated with Tag1's curl setup improvements on default.

What Promet did (Solr8 support)

  • Added Solr 8 version detection via $_ENV['search_version']
  • Added env var-based connection routing (PANTHEON_INDEX_HOST, PANTHEON_INDEX_PORT, etc.)
  • Added schema posting for Solr 8: sends entire config directory as base64-encoded JSON + server reload
  • Added pantheon_apachesolr_client_cert() and pantheon_apachesolr_certs_dir() for mTLS cert handling
  • Updated Pantheon_Search_Api_Solr_Service.php with Solr 8 connection/service/ping overrides
  • Did NOT touch Pantheon_Apache_Solr_Service.php (because apachesolr module didn't support Solr 8)

Tag1 (on default branch)

  • Added pantheon_apachesolr_curl_setup() helper for curl configuration with binding.pem (commit d09a9273b)
  • Handles local development environments where binding.pem doesn't exist (disables SSL verification)
  • Updated Drupal core to 7.105, tag1_d7es module to 7.x-1.4
  • Updated CircleCI config

This PR(solr9 support)

  • Merged Promet's branch into new SITE-5456-solr9 branch
  • Resolved merge conflicts in 4 files (CI configs, .module, Search API Solr service)
  • Changed all version checks from == 8 to == 9 and version strings from v8.11.0 to v9.10.0
  • Updated schema paths from 8.x to 9.x
  • Integrated Tag1's pantheon_apachesolr_curl_setup() with Promet's SSL/cert code in Pantheon_Search_Api_Solr_Service.php
  • Added full Solr 9 support to Pantheon_Apache_Solr_Service.php (Promet didn't touch this file since apachesolr didn't support Solr 8, but apachesolr 7.x-1.14 has native Solr 9 support)
    • Constructor: env var-based connection for Solr 9
    • setStats(): JSON parsing from /admin/system for Solr 9 (vs XML from /admin/stats.jsp for Solr 3)
    • getStatsSummary(): extract schema/core info from JSON response for Solr 9

Files changed

File Change
pantheon_apachesolr.module Version detection, schema posting (JSON + reload), stats, connection routing — all branched for Solr 9
Pantheon_Search_Api_Solr_Service.php Search API Solr connection/service/ping with Solr 9 env vars, integrated curl_setup SSL
Pantheon_Apache_Solr_Service.php Apache Solr Search connection class with Solr 9 env vars, JSON stats parsing
.github/workflows/update_tag1_d7es.yml Merge conflict resolution (kept default's version)

Module compatibility

Module Solr 3 Solr 9
Apache Solr Search (apachesolr) 7.x-1.14 Native Native
Search API Solr (search_api_solr) 7.x-1.19 Native Tag1 added solr9 support

Tag1 released Search API Solr version 7.x-1.8 with solr 9 support, so no need for community patch

Jira

SITE-5456

@rkunjappan rkunjappan changed the title Add Solr 9 support [SITE-5456] Add support for Solr 9 in D7 Apr 23, 2026
Comment thread .github/workflows/update_tag1_d7es.yml Outdated
run: .github/update_tag1_d7es.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} No newline at end of file
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

back this out, ci files are missing on master branch so this will fail the cherry pick.

Comment on lines +182 to +188
/**
* Return 'true' if the Pantheon Search Version is detected.
* @return bool
*/
function pantheon_apachesolr_search_version_detected() {
return isset($_ENV['search_version']);
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this method is only used once. just roll into pantheon_apachesolr_get_search_version.

CURLOPT_POSTFIELDS => json_encode($files),
);

curl_setopt_array($ch, $opts);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All other cases this is managed with pantheon_apachesolr_curl_setup and then adjusted, should we do here again, or is there a reason we're not?

Comment on lines +222 to +225
/**
* Legacy Supported Class for RC2.
*/
class PantheonSearchApiSolrService extends SearchApiSolrConnection {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines 128 to 129
class PantheonApachesolrSearchApiSolrService extends SearchApiSolrService {
protected $connection_class = 'PantheonApachesolrSearchApiSolrConnection';
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirming all of the new methods in here are from Promet/you as well (see previous comment re cleanup)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants