add duration to search parameters

This commit is contained in:
Gilles Crettenand
2015-06-16 10:11:56 +02:00
parent d797f62c47
commit f5c349b2e6
2 changed files with 26 additions and 2 deletions

View File

@@ -59,6 +59,11 @@ class BookSearch
$this->queryParts[] = $queryText;
}
public function addRange($field, $min = '*', $max = '*')
{
$this->queryParts[] = sprintf('%s:[%s TO %s]', $field, $min, $max);
}
public function addSortField($field, $order = \SolrQuery::ORDER_DESC)
{
$this->query->addSortField($field, $order);