public function SearchApiSolrBackend::extractContentFromFile in Search API Solr 8.3
Same name and namespace in other branches
- 8 src/Plugin/search_api/backend/SearchApiSolrBackend.php \Drupal\search_api_solr\Plugin\search_api\backend\SearchApiSolrBackend::extractContentFromFile()
- 8.2 src/Plugin/search_api/backend/SearchApiSolrBackend.php \Drupal\search_api_solr\Plugin\search_api\backend\SearchApiSolrBackend::extractContentFromFile()
- 4.x src/Plugin/search_api/backend/SearchApiSolrBackend.php \Drupal\search_api_solr\Plugin\search_api\backend\SearchApiSolrBackend::extractContentFromFile()
Throws
\Drupal\Component\Plugin\Exception\PluginException
Overrides SolrBackendInterface::extractContentFromFile
File
- src/
Plugin/ search_api/ backend/ SearchApiSolrBackend.php, line 4239
Class
- SearchApiSolrBackend
- Apache Solr backend for search api.
Namespace
Drupal\search_api_solr\Plugin\search_api\backendCode
public function extractContentFromFile($filepath) {
$connector = $this
->getSolrConnector();
$query = $connector
->getExtractQuery();
$query
->setExtractOnly(TRUE);
$query
->setFile($filepath);
// Execute the query.
$result = $connector
->extract($query);
return $connector
->getContentFromExtractResult($result, $filepath);
}