You are here

public function SolrConnectorPluginBase::getContentFromExtractResult in Search API Solr 8

Same name and namespace in other branches
  1. 8.3 src/SolrConnector/SolrConnectorPluginBase.php \Drupal\search_api_solr\SolrConnector\SolrConnectorPluginBase::getContentFromExtractResult()
  2. 8.2 src/SolrConnector/SolrConnectorPluginBase.php \Drupal\search_api_solr\SolrConnector\SolrConnectorPluginBase::getContentFromExtractResult()
  3. 4.x src/SolrConnector/SolrConnectorPluginBase.php \Drupal\search_api_solr\SolrConnector\SolrConnectorPluginBase::getContentFromExtractResult()

Gets the content from an extract query result.

Parameters

\Solarium\QueryType\Extract\Result $result:

string $filepath:

Return value

string

Overrides SolrConnectorInterface::getContentFromExtractResult

File

src/SolrConnector/SolrConnectorPluginBase.php, line 944

Class

SolrConnectorPluginBase
Defines a base class for Solr connector plugins.

Namespace

Drupal\search_api_solr\SolrConnector

Code

public function getContentFromExtractResult(ExtractResult $result, $filepath) {
  $response = $result
    ->getResponse();
  $json_data = $response
    ->getBody();
  $array_data = Json::decode($json_data);
  return $array_data[$filepath];
}