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 .= ' AND ';
$querystr .= '(path:'; $querystr .= '(path:';
$querystr .= str_replace(':', 'x', $fields['rootFolder']->getFolderList().$fields['rootFolder']->getID().':'); $querystr .= str_replace(':', 'x', $fields['rootFolder']->getFolderList().$fields['rootFolder']->getID().':');
$querystr .= ')'; $querystr .= '*)';
} }
if(!empty($fields['startFolder']) && $fields['startFolder']->getFolderList()) { if(!empty($fields['startFolder']) && $fields['startFolder']->getFolderList()) {
if($querystr) if($querystr)
$querystr .= ' AND '; $querystr .= ' AND ';
$querystr .= '(path:'; $querystr .= '(path:';
$querystr .= str_replace(':', 'x', $fields['startFolder']->getFolderList().$fields['startFolder']->getID().':'); $querystr .= str_replace(':', 'x', $fields['startFolder']->getFolderList().$fields['startFolder']->getID().':');
$querystr .= ')'; $querystr .= '*)';
} }
try { try {
$result = $this->index->find($querystr, $limit); $result = $this->index->find($querystr, $limit);

View File

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