mirror of
https://codeberg.org/SeedDMS/paperless
synced 2024-11-26 07:22:08 +00:00
need to get fulltext index first before searching
This commit is contained in:
parent
4aee2e9e3b
commit
38326621a1
|
@ -659,7 +659,8 @@ class SeedDMS_ExtPaperless_RestAPI_Controller { /* {{{ */
|
|||
/* more_like_id is set to find similar documents {{{ */
|
||||
if(isset($params['more_like_id'])) {
|
||||
|
||||
if($fulltextservice && $lucenesearch = $fulltextservice->Search()) {
|
||||
if($fulltextservice && $index = $fulltextservice->Indexer()) {
|
||||
$lucenesearch = $fulltextservice->Search();
|
||||
if($searchhit = $lucenesearch->getDocument((int) $params['more_like_id'])) {
|
||||
$idoc = $searchhit->getDocument();
|
||||
if($idoc) {
|
||||
|
@ -800,7 +801,8 @@ class SeedDMS_ExtPaperless_RestAPI_Controller { /* {{{ */
|
|||
$aend = (int) makeTsFromDate($params['created__date__lt']);
|
||||
}
|
||||
|
||||
if($fulltextservice && $lucenesearch = $fulltextservice->Search()) {
|
||||
if($fulltextservice && $index = $fulltextservice->Indexer()) {
|
||||
$lucenesearch = $fulltextservice->Search();
|
||||
$logger->log('Query is '.$query, PEAR_LOG_DEBUG);
|
||||
/*
|
||||
$logger->log('User is '.$userobj->getLogin(), PEAR_LOG_DEBUG);
|
||||
|
@ -991,7 +993,8 @@ class SeedDMS_ExtPaperless_RestAPI_Controller { /* {{{ */
|
|||
'documents_inbox'=>0,
|
||||
);
|
||||
|
||||
if($fulltextservice && ($lucenesearch = $fulltextservice->Search())) {
|
||||
if($fulltextservice && ($index = $fulltextservice->Indexer())) {
|
||||
$lucenesearch = $fulltextservice->Search();
|
||||
$searchresult = $lucenesearch->search('', array('record_type'=>['document'], 'status'=>[2], 'user'=>[$userobj->getLogin()], 'startFolder'=>$startfolder, 'rootFolder'=>$startfolder), array('limit'=>1), array(), array('no_facets'=>true));
|
||||
if($searchresult === false) {
|
||||
return $response->withStatus(500);
|
||||
|
|
Loading…
Reference in New Issue
Block a user