Setup

  • Solr version:
  • 8

  • Drupal Core version:
  • 9.4.7

  • Search API version:
  • 1.26

  • Search API Solr version:
  • 4.2.9

  • Configured Solr Connector:

Issue

I am receiving this warning message
Warning: Array to string conversion in Drupal\search_api_solr\Plugin\search_api\backend\SearchApiSolrBackend->extractResults() (line 2922 of modules/contrib/search_api_solr/src/Plugin/search_api/backend/SearchApiSolrBackend.php).
It seems that it is because $doc_fields['hash'] can sometimes be an array.

Like the solution in this issue https://www.drupal.org/project/search_api_solr/issues/3281703 I have added a patch that checks if this is as an array and then get the current index of the array. The patch attached may only apply if the patch from the MR in 3281703 is also applied.

Comments

mjmorley created an issue. See original summary.

mkalkbrenner’s picture

Before I commit that patch, can you please check the Solr schema that is in use?

I wonder if these errors are caused by using Solr's default managed schema instead of the scheme this module provides.
That default schema uses a string multiple type for everything.

mkalkbrenner’s picture

Status: Needs review » Postponed (maintainer needs more info)
rastepanyan’s picture

The approach implemented in the patch above is working for me. I have created a patch compatible with Search API Solr version 4.2.1, which I'm using together with Search API version 1.23. The PHP version is 7.4.30, MySQL version is 5.5 and the Drupal Core version is 8.9.20.

mkalkbrenner’s picture

Status: Postponed (maintainer needs more info) » Needs review

mkalkbrenner’s picture

Version: 4.2.9 » 4.x-dev
Status: Needs review » Fixed
rajivgandhi chinnakrishnan’s picture

StatusFileSize
new1.06 KB

Created a new patch for the Search API Solr version 4.2.12.

Status: Fixed » Closed (fixed)

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