public function visit(SortClause $sortClause)
{
/** @var \eZ\Publish\API\Repository\Values\Content\Query\SortClause\Target\FieldTarget $target */
$target = $sortClause->targetData;
$fieldName = $this->getSortFieldName($sortClause, $target->typeIdentifier, $target->fieldIdentifier);
if ($fieldName === null) {
throw new InvalidArgumentException('$sortClause->targetData', 'No searchable fields found for the given sort clause target ' . "'{$target->fieldIdentifier}' on '{$target->typeIdentifier}'.");
}
return array("fields_doc.{$fieldName}" => array('nested_filter' => array('term' => $this->getNestedFilterTerm(null)), 'order' => $this->getDirection($sortClause)));
}