You are here

protected function SolrFieldType::getSpellcheckField in Search API Solr 4.x

Same name and namespace in other branches
  1. 8.3 src/Entity/SolrFieldType.php \Drupal\search_api_solr\Entity\SolrFieldType::getSpellcheckField()

Returns the spellcheck field definition.

Return value

array|null The array containing the spellcheck field definition or null if is not configured for this field type.

1 call to SolrFieldType::getSpellcheckField()
SolrFieldType::getDynamicFields in src/Entity/SolrFieldType.php
Gets a list of dynamic Solr fields that will use this Solr Field Type.

File

src/Entity/SolrFieldType.php, line 493

Class

SolrFieldType
Defines the SolrFieldType entity.

Namespace

Drupal\search_api_solr\Entity

Code

protected function getSpellcheckField() {
  $spellcheck_field = NULL;
  if ($this->spellcheck_field_type) {
    $spellcheck_field = [
      // Don't use the language separator here! This field name is used
      // without it in the solrconfig.xml. Due to the fact that we leverage a
      // dynamic field here to enable the language fallback we need to append
      // '*', but not '_*' because we'll never append a field name!
      'name' => 'spellcheck_' . $this->field_type_language_code . '*',
      'type' => $this->spellcheck_field_type['name'],
      'stored' => TRUE,
      'indexed' => TRUE,
      'multiValued' => TRUE,
      'termVectors' => TRUE,
      'omitNorms' => TRUE,
    ];
  }
  return $spellcheck_field;
}