mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-14 05:31:42 +00:00
allow to filter search by creation date
This commit is contained in:
parent
35e2f86dba
commit
276ca2c5f4
|
@ -139,8 +139,20 @@ class SeedDMS_SQliteFTS_Search {
|
||||||
$querystr .= str_replace(':', 'x', $fields['startFolder']->getFolderList().$fields['startFolder']->getID().':');
|
$querystr .= str_replace(':', 'x', $fields['startFolder']->getFolderList().$fields['startFolder']->getID().':');
|
||||||
$querystr .= '*)';
|
$querystr .= '*)';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$filterstr = '';
|
||||||
|
if(!empty($fields['created_start'])) {
|
||||||
|
if($filterstr)
|
||||||
|
$filterstr .= ' AND ';
|
||||||
|
$filterstr .= '(created>='.$fields['created_start'].')';
|
||||||
|
}
|
||||||
|
if(!empty($fields['created_end'])) {
|
||||||
|
if($filterstr)
|
||||||
|
$filterstr .= ' AND ';
|
||||||
|
$filterstr .= '(created<'.$fields['created_end'].')';
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
$result = $this->index->find($querystr, $limit, $order);
|
$result = $this->index->find($querystr, $filterstr, $limit, $order);
|
||||||
$recs = array();
|
$recs = array();
|
||||||
foreach($result["hits"] as $hit) {
|
foreach($result["hits"] as $hit) {
|
||||||
$recs[] = array('id'=>$hit->id, 'document_id'=>$hit->documentid);
|
$recs[] = array('id'=>$hit->id, 'document_id'=>$hit->documentid);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user