You are here

public function SolrFieldType::setSpellcheckFieldTypeAsJson in Search API Solr 8.3

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

Sets the Solr Spellcheck Field Type definition as JSON.

Decodes the Solr Field Type definition encoded as JSON and stores an nested associative array internally. This method in useful to import a field type from an existing Solr server.

Parameters

string $spellcheck_field_type: The Solr Spellcheck Field Type definition as JSON, might be empty if it doesn't exist.

Return value

self Spellcheck field type as json.

Overrides SolrFieldTypeInterface::setSpellcheckFieldTypeAsJson

File

src/Entity/SolrFieldType.php, line 307

Class

SolrFieldType
Defines the SolrFieldType entity.

Namespace

Drupal\search_api_solr\Entity

Code

public function setSpellcheckFieldTypeAsJson($spellcheck_field_type) {
  $this->spellcheck_field_type = Json::decode($spellcheck_field_type);
  return $this;
}