You are here

public function SolrFieldDefinition::isPossibleKey in Search API Solr 4.x

Same name and namespace in other branches
  1. 8.3 src/TypedData/SolrFieldDefinition.php \Drupal\search_api_solr\TypedData\SolrFieldDefinition::isPossibleKey()
  2. 8.2 src/TypedData/SolrFieldDefinition.php \Drupal\search_api_solr\TypedData\SolrFieldDefinition::isPossibleKey()

Determine whether this field may be suitable for use as a key field.

Unfortunately, it seems like the best way to find an actual uniqueKey field according to Solr is to examine the Solr core's schema.xml.

Return value

bool Whether the field is suitable for use as a key.

Overrides SolrFieldDefinitionInterface::isPossibleKey

File

src/TypedData/SolrFieldDefinition.php, line 194

Class

SolrFieldDefinition
Defines a class for Solr field definitions.

Namespace

Drupal\search_api_solr\TypedData

Code

public function isPossibleKey() {
  return !$this
    ->getDynamicBase() && $this
    ->isStored() && !$this
    ->isMultivalued();
}