You are here

public function SearchApiSolrField::isSortable in Search API Solr 7

Determines whether a field is suitable for sorting.

In order for a field to yield useful sorted results in Solr, it must be indexed, not multivalued, and not tokenized. It's ok if a field is tokenized and yields only one token, but there's no general way to check for that.

Return value

bool Whether the field is suitable for sorting.

File

includes/solr_field.inc, line 132

Class

SearchApiSolrField
Logic around Solr field schema information.

Code

public function isSortable() {
  return $this
    ->isIndexed() && !$this
    ->isMultivalued() && !$this
    ->isTokenized();
}