You are here

public static function Utility::hasIndexJustSolrDocumentDatasource in Search API Solr 8.3

Same name and namespace in other branches
  1. 4.x src/Utility/Utility.php \Drupal\search_api_solr\Utility\Utility::hasIndexJustSolrDocumentDatasource()

Returns whether the index only contains "solr_document" datasources.

Parameters

\Drupal\search_api\IndexInterface $index: The Search API index entity.

Return value

bool TRUE if the index only contains "solr_document" datasources, FALSE otherwise.

5 calls to Utility::hasIndexJustSolrDocumentDatasource()
SearchApiSolrBackend::getRequiredFields in src/Plugin/search_api/backend/SearchApiSolrBackend.php
Get the list of fields Solr must return as result.
SearchApiSolrBackend::hasIndexJustSolrDocumentDatasource in src/Plugin/search_api/backend/SearchApiSolrBackend.php
Returns whether the index only contains "solr_document" datasources.
SearchApiSolrBackend::search in src/Plugin/search_api/backend/SearchApiSolrBackend.php
Options on $query prefixed by 'solr_param_' will be passed natively to Solr as query parameter without the prefix. For example you can set the "Minimum Should Match" parameter 'mm' to '75%' like this:
StreamingExpressionBuilder::__construct in src/Utility/StreamingExpressionBuilder.php
StreamingExpressionBuilder constructor.
Utility::getSortableSolrField in src/Utility/Utility.php
Gets the sortable equivalent of a dynamic Solr field.

File

src/Utility/Utility.php, line 960

Class

Utility
Provides various helper functions for Solr backends.

Namespace

Drupal\search_api_solr\Utility

Code

public static function hasIndexJustSolrDocumentDatasource(IndexInterface $index) : bool {
  $datasource_ids = $index
    ->getDatasourceIds();
  return 1 === count($datasource_ids) && in_array('solr_document', $datasource_ids);
}