class SolrMultisiteFieldManager in Search API Solr 8.3
Same name and namespace in other branches
- 4.x src/SolrMultisiteFieldManager.php \Drupal\search_api_solr\SolrMultisiteFieldManager
Manages the discovery of Solr fields.
Hierarchy
- class \Drupal\search_api_solr\SolrFieldManager implements SolrFieldManagerInterface uses UseCacheBackendTrait, StringTranslationTrait, LoggerTrait
- class \Drupal\search_api_solr\SolrMultisiteFieldManager
Expanded class hierarchy of SolrMultisiteFieldManager
1 string reference to 'SolrMultisiteFieldManager'
1 service uses SolrMultisiteFieldManager
File
- src/
SolrMultisiteFieldManager.php, line 11
Namespace
Drupal\search_api_solrView source
class SolrMultisiteFieldManager extends SolrFieldManager {
/**
* Builds the field definitions for a multisite index.
*
* @param \Drupal\search_api\IndexInterface $index
* The index from which we are retrieving field information.
*
* @return \Drupal\Core\TypedData\DataDefinitionInterface[]
* The array of field definitions for the server, keyed by field name.
*
* @throws \Drupal\search_api\SearchApiException
*/
protected function buildFieldDefinitions(IndexInterface $index) {
$fields = [];
foreach ($index
->getFields() as $index_field) {
$solr_field = $index_field
->getPropertyPath();
$field = new SolrMultisiteFieldDefinition([
'multivalued' => preg_match('/^[a-z]+m_/', $solr_field),
]);
$field
->setLabel($index_field
->getLabel());
$field
->setDataType($index_field
->getType());
$fields[$solr_field] = $field;
}
return $fields;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
LoggerTrait:: |
protected | property | The logging channel to use. | |
LoggerTrait:: |
public | function | Retrieves the logger. | |
LoggerTrait:: |
protected | function | Logs an exception. | |
LoggerTrait:: |
public | function | Sets the logger. | |
SolrFieldManager:: |
protected | property | Static cache of field definitions per Solr server. | |
SolrFieldManager:: |
protected | property | Storage for Search API servers. | |
SolrFieldManager:: |
protected | function | Builds the field definitions from exiting index config. | |
SolrFieldManager:: |
protected | function | Builds the field definitions for a Solr server from its Luke handler. | |
SolrFieldManager:: |
public | function |
Overrides SolrFieldManagerInterface:: |
|
SolrFieldManager:: |
public | function | Constructs a new SorFieldManager. | |
SolrMultisiteFieldManager:: |
protected | function |
Builds the field definitions for a multisite index. Overrides SolrFieldManager:: |
|
StringTranslationTrait:: |
protected | property | The string translation service. | 1 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. | |
UseCacheBackendTrait:: |
protected | property | Cache backend instance. | |
UseCacheBackendTrait:: |
protected | property | Flag whether caches should be used or skipped. | |
UseCacheBackendTrait:: |
protected | function | Fetches from the cache backend, respecting the use caches flag. | 1 |
UseCacheBackendTrait:: |
protected | function | Stores data in the persistent cache, respecting the use caches flag. |