fix query if rootFolder or startFolder is set

This commit is contained in:
Uwe Steinmann 2022-06-09 15:18:53 +02:00
parent 12e9a803bc
commit 89c6dc580a
2 changed files with 3 additions and 2 deletions

View File

@ -130,14 +130,14 @@ class SeedDMS_SQliteFTS_Search {
$querystr .= ' AND ';
$querystr .= '(path:';
$querystr .= str_replace(':', 'x', $fields['rootFolder']->getFolderList().$fields['rootFolder']->getID().':');
$querystr .= ')';
$querystr .= '*)';
}
if(!empty($fields['startFolder']) && $fields['startFolder']->getFolderList()) {
if($querystr)
$querystr .= ' AND ';
$querystr .= '(path:';
$querystr .= str_replace(':', 'x', $fields['startFolder']->getFolderList().$fields['startFolder']->getID().':');
$querystr .= ')';
$querystr .= '*)';
}
try {
$result = $this->index->find($querystr, $limit);

View File

@ -24,6 +24,7 @@
<license uri="http://opensource.org/licenses/gpl-license">GPL License</license>
<notes>
- throw exeption in find() instead of returning false
- fix query if rootFolder or startFolder is set
</notes>
<contents>
<dir baseinstalldir="SeedDMS" name="/">