You are here

public function SearchApiGroupingViewsHandlerSort::query in Search API Grouping 7.2

Called to add the sort to a query.

Overrides SearchApiViewsHandlerSort::query

File

includes/views_handler_sort.inc, line 16
Contains SearchApiGroupingViewsHandlerSort.

Class

SearchApiGroupingViewsHandlerSort
Avoid exceptions about fields that originally where lists but due the denormalizing now are single valued and thus sortable.

Code

public function query() {

  // Adjust the type of this field to avoid exceptions in parent::query(). All
  // fields handled by this handler have proven to be single value really.
  // Thus just extract the inner type and set it.
  $index = $this->query
    ->getIndex();
  $index->options['fields'][$this->real_field]['type'] = search_api_extract_inner_type($index->options['fields'][$this->real_field]['type']);
  return parent::query();
}