final protected function process(\SelectQueryInterface $select, Query $query)
    {
        $sortField = null;

        if ($query->hasSortField()) {
            $sortField = $query->getSortField();

            $select->orderBy($this->fields[$sortField]['column'], Query::SORT_DESC === $query->getSortOrder() ? 'desc' : 'asc');
        }

        // Add a predictible ordering column
        if ($sortField !== $this->idColumn) {
            $select->orderBy($this->idColumn, Query::SORT_DESC === $query->getSortOrder() ? 'desc' : 'asc');
        }

        if ($this->fulltextField) {
            if ($searchstring = $query->getSearchString()) {
                $select->condition($this->fulltextField, '%'.db_like($searchstring).'%', 'LIKE');
            }
        }

        $this->applyFilters($select, $query);

        return $select;
    }