You are here

public function SolrFieldType::getSpellcheckFieldTypeAsXml 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::getSpellcheckFieldTypeAsXml()

Gets the Solr Spellcheck Spellcheck Field Type definition as XML fragment.

The XML format is used as part of a classic Solr schema.

Parameters

bool $add_comment: Wether to add a comment to the XML or not to explain the purpose of this Solr Field Type.

Return value

string The Solr Spellcheck Field Type definition as XML, might be empty if it doesn't exist.

Overrides SolrFieldTypeInterface::getSpellcheckFieldTypeAsXml

File

src/Entity/SolrFieldType.php, line 369

Class

SolrFieldType
Defines the SolrFieldType entity.

Namespace

Drupal\search_api_solr\Entity

Code

public function getSpellcheckFieldTypeAsXml($add_comment = TRUE) {
  return $this->spellcheck_field_type ? $this
    ->getSubFieldTypeAsXml($this->spellcheck_field_type, ' spellcheck') : '';
}