0

I have Drupal 8.7.1, Solr 8.1. My Solr Server is running and my content is indexed. server and index have status ok enter image description here But I have no results (with a query or without) in my view, and an error: Drupal\search_api\SearchApiException: The datasource with ID '' could not be retrieved for index 'Solr search index'. in Drupal\search_api\Entity\Index->getDatasource() (line 365 of C:\Users\Oksana\Documents\sites\drupal2\modules\search_api\src\Entity\Index.php).

The function that produces this error in the indicated file is:

 /**
   * {@inheritdoc}
   */
  public function getDatasource($datasource_id) {
    $datasources = $this->getDatasources();

    if (empty($datasources[$datasource_id])) {
      $index_label = $this->label();
      throw new SearchApiException("The datasource with ID '$datasource_id' could not be retrieved for index '$index_label'.");
    }

    return $datasources[$datasource_id];
  }

As I understand, the Search API module receives no results from Solr.

If I type http://localhost:8983/solr/first_solr_core/select?indent=on&q= in browser, I get:

{
  "responseHeader":{
    "status":0,
    "QTime":1,
    "params":{
      "q":"",
      "indent":"on"}},
  "response":{"numFound":0,"start":0,"docs":[]
  }}

Which means, as I understood, that Solr has no results.

How can I find where is the problem (what happens with results after contents are indexed, and where results disappear)?

Thank you

2

Possible problem: "Search API Solr" module 8.x-2.7 does not support Solr 8.

Solution:

  1. Remove "Search API Solr" module 8.x-2.7 using 'composer remove drupal/search_api_solr'

  2. Install "Search API Solr" module 8.x-3.1 using 'composer require drupal/search_api_solr'

  3. Find Solr modules in Drupal BO ("Extend" > "List") and click "Install" button

  4. Add Solr Server in Drupal BO. I used solr path "/".

  5. Download the configs zip folder from Drupal BO, copy files from the folder to the conf directory of the Solr core. (See details in INSTALL.md file in the module directory).

  6. Restart solr server.
  7. In Drupal BO in my Index configs select the name of my Solr server.
  8. Go to the Index in Drupal BO. Click to run the index of content.
  9. Go to my previously confiured view. See search results and search!
  • This is true - version 3.x supports Solr 8. – Kevin Jun 18 at 2:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.