protected function getCondition(Criterion $criterion)
{
$fieldNames = $this->getFieldNames($criterion, $criterion->target);
$value = (array) $criterion->value;
if (empty($fieldNames)) {
throw new InvalidArgumentException('$criterion->target', "No searchable fields found for the given criterion target '{$criterion->target}'.");
}
$start = $value[0];
$end = isset($value[1]) ? $value[1] : null;
if ($criterion->operator === Operator::LT || $criterion->operator === Operator::LTE) {
$end = $start;
$start = null;
}
$fields = array();
foreach ($fieldNames as $name) {
$fields[] = 'fields_doc.' . $name;
}
return array('query_string' => array('fields' => $fields, 'query' => $this->getQueryRange($criterion->operator, $start, $end)));
}