Drupal 8 & Solr 8.1: No search results, error: "The datasource with ID '' could not be retrieved for index..." I have Drupal 8.7.1, Solr 8.1.
My Solr Server is running and my content is indexed.


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-&gt;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-&gt;getDatasources();

    if (empty($datasources[$datasource_id])) {
      $index_label = $this-&gt;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&amp;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
Possible problem: "Search API Solr" module 8.x-2.7 does not support Solr 8.

Solution:


Remove "Search API Solr" module 8.x-2.7 using 'composer remove drupal/search_api_solr'
Install "Search API Solr" module 8.x-3.1 using 'composer require drupal/search_api_solr'
Find Solr modules in Drupal BO ("Extend" > "List") and click "Install" button
Add Solr Server in Drupal BO. I used solr path "/". 
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).
Restart solr server.
In Drupal BO in my Index configs select the name of my Solr server.
Go to the Index in Drupal BO. Click to run the index of content.
Go to my previously confiured view. See search results and search!