if (isset($payload['term'
])) { $term =
trim((string) $payload['term'
]);
$criteria->
setTerm($term);
} if (isset($payload['sort'
])) { $this->
addSorting($payload,
$criteria,
$definition,
$searchException);
} if (isset($payload['aggregations'
])) { $this->aggregationParser->
buildAggregations($definition,
$payload,
$criteria,
$searchException);
} if (isset($payload['associations'
])) { foreach ($payload['associations'
] as $propertyName =>
$association) { if (!\
is_array($association)) { continue;
} $field =
$definition->
getFields()->
get($propertyName);
if (!
$field instanceof AssociationField
) {