With the most recent dev version (also for search_api and search_api_solr), I get the following error. It might be a configuration issue (string vs fulltext fields) or the code might depend on different module versions.

The website encountered an unexpected error. Please try again later.
Error: Call to a member function getText() on string in Drupal\search_api_solr\Plugin\search_api\backend\SearchApiSolrBackend->getExcerpt() (line 2203 of modules/contrib/search_api_solr/src/Plugin/search_api/backend/SearchApiSolrBackend.php).
Drupal\search_api_solr\Plugin\search_api\backend\SearchApiSolrBackend->getExcerpt(Array, '83u8st-solr_content-entity:media/10:de', Object, Array) (Line: 1441)
Drupal\search_api_solr\Plugin\search_api\backend\SearchApiSolrBackend->extractResults(Object, Object) (Line: 1016)
Drupal\search_api_solr\Plugin\search_api\backend\SearchApiSolrBackend->search(Object) (Line: 455)
Drupal\search_api\Entity\Server->search(Object) (Line: 493)
Drupal\search_api\Query\Query->execute() (Line: 437)
Drupal\search_api\Plugin\views\query\SearchApiQuery->execute(Object) (Line: 1412)
Drupal\views\ViewExecutable->execute(NULL) (Line: 1440)
Drupal\views\ViewExecutable->render() (Line: 412)
Drupal\rest\Plugin\views\display\RestExport->execute() (Line: 1616)
Drupal\views\ViewExecutable->executeDisplay('rest_export_1', Array) (Line: 78)
Drupal\views\Element\View::preRenderViewElement(Array)
call_user_func(Array, Array) (Line: 376)
Drupal\Core\Render\Renderer->doRender(Array, 1) (Line: 195)
Drupal\Core\Render\Renderer->render(Array, 1) (Line: 139)
Drupal\Core\Render\Renderer->Drupal\Core\Render\{closure}() (Line: 574)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 140)
Drupal\Core\Render\Renderer->renderRoot(Array) (Line: 395)
Drupal\rest\Plugin\views\display\RestExport::buildResponse('search', 'rest_export_1', Array) (Line: 52)
Drupal\views\Routing\ViewPageController->handle('search', 'rest_export_1', Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 574)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
call_user_func_array(Object, Array) (Line: 144)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 64)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 656)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Members fund testing for the Drupal project. Drupal Association Learn more

Comments

kjauslin created an issue. See original summary.

kjauslin’s picture

Please find patch attached. It prevents the error, but might not solve the root cause.

kjauslin’s picture

mkalkbrenner’s picture

Priority: Normal » Major
Status: Active » Needs review

Interesting, can you share some information about the field that is represented as string here?
Maybe this bug was introduced as TextValue was introduced in Search API.

prajaankit’s picture

Assigned: Unassigned » prajaankit
prajaankit’s picture

FileSize
37.96 KB
11.83 KB

Hi mkalkbrenner,

I face the same, This issue is ariese after the update module search Api solr from 8.x-1.0-rc2 to 8.x-1.0-rc4.

System configuration
Drupal version : 8.3.4
php version : 7.1
OS : centos
Solr version : 5.5.3
solr-conf : 6.x
All these fields Typ Full text are indexed.

As per updated module as well as update in solr-conf in solr files on server also.
Disable the index and again enable it, and again reindex all these fields, But unfortunately search is not working.
clear the cache drush cr several time.

Then i applied #2 patch its applied successfully
Now the search perform well, gives the expected results.

Any other information you want please let me know.

Thanks :)

prajaankit’s picture

Assigned: prajaankit » Unassigned

  • mkalkbrenner committed 34d41ff on 8.x-1.x
    Issue #2883702 by kjauslin, mkalkbrenner: Call to a member function...
mkalkbrenner’s picture

Status: Needs review » Fixed

Even if this should not occur in a standard setup, I accept the patch for the initiative of supporting foreign indexes.

Status: Fixed » Closed (fixed)

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