public function SearchApiSolrBackend::supportsDataType in Search API Solr 8.2
Same name and namespace in other branches
- 8.3 src/Plugin/search_api/backend/SearchApiSolrBackend.php \Drupal\search_api_solr\Plugin\search_api\backend\SearchApiSolrBackend::supportsDataType()
- 8 src/Plugin/search_api/backend/SearchApiSolrBackend.php \Drupal\search_api_solr\Plugin\search_api\backend\SearchApiSolrBackend::supportsDataType()
- 4.x src/Plugin/search_api/backend/SearchApiSolrBackend.php \Drupal\search_api_solr\Plugin\search_api\backend\SearchApiSolrBackend::supportsDataType()
Determines whether the backend supports a given add-on data type.
Parameters
string $type: The identifier of the add-on data type.
Return value
bool TRUE if the backend supports that data type.
Overrides BackendPluginBase::supportsDataType
File
- src/
Plugin/ search_api/ backend/ SearchApiSolrBackend.php, line 460
Class
- SearchApiSolrBackend
- Apache Solr backend for search api.
Namespace
Drupal\search_api_solr\Plugin\search_api\backendCode
public function supportsDataType($type) {
static $custom_codes = [];
if (strpos($type, 'solr_text_custom') === 0) {
list(, $custom_code) = explode(':', $type);
if (empty($custom_codes)) {
$custom_codes = SolrFieldType::getAvailableCustomCodes();
}
return in_array($custom_code, $custom_codes);
}
return in_array($type, [
'location',
'rpt',
'solr_string_doc_values',
'solr_string_ngram',
'solr_string_storage',
'solr_text_ngram',
'solr_text_omit_norms',
'solr_text_phonetic',
'solr_text_suggester',
'solr_text_unstemmed',
'solr_text_wstoken',
'solr_date_range',
]);
}