"Exception while improving searchresult", no results displayed
I have a search that is returning an **Exception while improving search result" . Even though a result count is given, no results are displayed. I've narrowed it down to a small search that reproduces the problem.
{
"reqId": "YUTulVnoYipEuy8DeFLD5wAAAEU",
"level": 2,
"time": "September 17, 2021 15:37:57",
"remoteAddr": "10.16.12.78",
"user": "cqcj",
"app": "files_fulltextsearch",
"method": "GET",
"url": "/index.php/apps/fulltextsearch/v1/search?request=%7B%22providers%22%3A%22all%22%2C%22options%22%3A%7B%22files_local%22%3A%220%22%2C%22files_external%22%3A%220%22%2C%22files_group_folders%22%3A%220%22%2C%22files_extension%22%3A%22txt%22%7D%2C%22search%22%3A%22rightfax%22%2C%22page%22%3A1%7D",
"message": "Exception while improving searchresult: - trace: [{\"file\":\"\\/var\\/www\\/nextcloud\\/apps\\/files_fulltextsearch\\/lib\\/Service\\/SearchService.php\",\"line\":275,\"function\":\"getFileFromId\",\"class\":\"OCA\\\\Files_FullTextSearch\\\\Service\\\\FilesService\",\"type\":\"->\",\"args\":[\"cqcj\",2702514]},{\"file\":\"\\/var\\/www\\/nextcloud\\/apps\\/files_fulltextsearch\\/lib\\/Service\\/SearchService.php\",\"line\":235,\"function\":\"setDocumentInfo\",\"class\":\"OCA\\\\Files_FullTextSearch\\\\Service\\\\SearchService\",\"type\":\"->\",\"args\":[{\"id\":\"2702514\",\"providerId\":\"files\",\"access\":{\"ownerId\":\"\",\"viewerId\":\"cqcj\",\"users\":[],\"groups\":[],\"circles\":[],\"links\":[]},\"modifiedTime\":0,\"title\":\"Server\\/Procedures\\/Right Fax Docs\\/OLDRFDocs\\/TestProgram04 setup\\/d\\/VB\\/RF2VBAX-ReadMe.txt\",\"link\":\"\",\"index\":null,\"source\":\"files_group_folders\",\"info\":{\"webdav\":\"02702514oc17jp1qv20b\"},\"hash\":\"30a14df804cba889191775aa0d9b88ba\",\"contentSize\":0,\"tags\":[],\"metatags\":[],\"subtags\":[],\"more\":[],\"excerpts\":[{\"source\":\"content\",\"excerpt\":\"================ RF2VBAX is an ActiveX control that provides a simpler interface to the RightFAX VB\"}],\"score\":\"0\"}]},{\"file\":\"\\/var\\/www\\/nextcloud\\/apps\\/files_fulltextsearch\\/lib\\/Provider\\/FilesProvider.php\",\"line\":362,\"function\":\"improveSearchResult\",\"class\":\"OCA\\\\Files_FullTextSearch\\\\Service\\\\SearchService\",\"type\":\"->\",\"args\":[{\"provider\":{\"id\":\"files\",\"name\":\"Files\"},\"platform\":{\"id\":\"elastic_search\",\"name\":\"Elasticsearch\"},\"documents\":[{\"id\":\"2670372\",\"providerId\":\"files\",\"access\":{\"ownerId\":\"\",\"viewerId\":\"cqcj\",\"users\":[],\"groups\":[],\"circles\":[],\"links\":[]},\"modifiedTime\":0,\"title\":\"Shared-du.txt\",\"link\":\"\",\"index\":null,\"source\":\"files_local\",\"info\":[],\"hash\":\"ec58ea61348c3fb42a7edc6abd69d254\",\"contentSize\":0,\"tags\":[],\"metatags\":[],\"subtags\":[],\"more\":[],\"excerpts\":[{\"source\":\"content\",\"excerpt\":\"OnBaseDSSBEV 2830 OnbasePhoneRequest 8 ONBASETEST 1464 OnBaseUserManuals 2512 ONETCBT 496 OpenText RightFax\"},{\"source\":\"content\",\"excerpt\":\"RFP du: cannot read directory 'RFPDoIT-DOC': Permission denied 0 RFPDoIT-DOC 512 RICI 0 Ricoh 16600 RightFaxReports\"}],\"score\":\"0\"},{\"id\":\"2685987\",\"providerId\":\"files\",\"access\":{\"ownerId\":\"\",\"viewerId\":\"cqcj\",\"users\":[],\"groups\":[],\"circles\":[],\"links\":[]},\"modifiedTime\":0,\"title\":\"ServerTeam\\/DNS-Data\\/NTWK323-CNAME-DNS.txt\",\"link\":\"\",\"index\":null,\"source\":\"files_external\",\"info\":[],\"hash\":\"7c08736aca02d9ea398d317ee6873508\",\"contentSize\":0,\"tags\":[],\"metatags\":[],\"subtags\":[],\"more\":[],\"excerpts\":[{\"source\":\"content\",\"excerpt\":\"rightfax 1200 CNAME srvr340.westchestergov.com.\"},{\"source\":\"content\",\"excerpt\":\"rightfaxconnector 300 CNAME exch235.westchestergov.com.\"}],\"score\":\"0\"},{\"id\":\"2702552\",\"providerId\":\"files\",\"access\":{\"ownerId\":\"\",\"viewerId\":\"cqcj\",\"users\":[],\"groups\":[],\"circles\":[],\"links\":[]},\"modifiedTime\":0,\"title\":\"Server\\/Procedures\\/Right Fax Docs\\/OLDRFDocs\\/RfDoitDocs\\/T1 Info.txt\",\"link\":\"\",\"index\":null,\"source\":\"files_group_folders\",\"info\":[],\"hash\":\"0c601201f1c8a13285f0de81f207611f\",\"contentSize\":0,\"tags\":[],\"metatags\":[],\"subtags\":[],\"more\":[],\"excerpts\":[{\"source\":\"content\",\"excerpt\":\"RightFax Circuit \\/ line: New 08HNXS1. The order # was XXXXXXXXX.\"}],\"score\":\"0\"},{\"id\":\"2702514\",\"providerId\":\"files\",\"access\":{\"ownerId\":\"\",\"viewerId\":\"cqcj\",\"users\":[],\"groups\":[],\"circles\":[],\"links\":[]},\"modifiedTime\":0,\"title\":\"Server\\/Procedures\\/Right Fax Docs\\/OLDRFDocs\\/TestProgram04 setup\\/d\\/VB\\/RF2VBAX-ReadMe.txt\",\"link\":\"\",\"index\":null,\"source\":\"files_group_folders\",\"info\":[],\"hash\":\"30a14df804cba889191775aa0d9b88ba\",\"contentSize\":0,\"tags\":[],\"metatags\":[],\"subtags\":[],\"more\":[],\"excerpts\":[{\"source\":\"content\",\"excerpt\":\"================ RF2VBAX is an ActiveX control that provides a simpler interface to the RightFAX VB\"}],\"score\":\"0\"}],\"info\":[],\"meta\":{\"timedOut\":false,\"time\":41,\"count\":4,\"total\":4,\"maxScore\":10}}]},{\"file\":\"\\/var\\/www\\/nextcloud\\/apps\\/fulltextsearch\\/lib\\/Service\\/SearchService.php\",\"line\":203,\"function\":\"improveSearchResult\",\"class\":\"OCA\\\\Files_FullTextSearch\\\\Provider\\\\FilesProvider\",\"type\":\"->\",\"args\":[{\"provider\":{\"id\":\"files\",\"name\":\"Files\"},\"platform\":{\"id\":\"elastic_search\",\"name\":\"Elasticsearch\"},\"documents\":[{\"id\":\"2670372\",\"providerId\":\"files\",\"access\":{\"ownerId\":\"\",\"viewerId\":\"cqcj\",\"users\":[],\"groups\":[],\"circles\":[],\"links\":[]},\"modifiedTime\":0,\"title\":\"Shared-du.txt\",\"link\":\"\",\"index\":null,\"source\":\"files_local\",\"info\":[],\"hash\":\"ec58ea61348c3fb42a7edc6abd69d254\",\"contentSize\":0,\"tags\":[],\"metatags\":[],\"subtags\":[],\"more\":[],\"excerpts\":[{\"source\":\"content\",\"excerpt\":\"OnBaseDSSBEV 2830 OnbasePhoneRequest 8 ONBASETEST 1464 OnBaseUserManuals 2512 ONETCBT 496 OpenText RightFax\"},{\"source\":\"content\",\"excerpt\":\"RFP du: cannot read directory 'RFPDoIT-DOC': Permission denied 0 RFPDoIT-DOC 512 RICI 0 Ricoh 16600 RightFaxReports\"}],\"score\":\"0\"},{\"id\":\"2685987\",\"providerId\":\"files\",\"access\":{\"ownerId\":\"\",\"viewerId\":\"cqcj\",\"users\":[],\"groups\":[],\"circles\":[],\"links\":[]},\"modifiedTime\":0,\"title\":\"ServerTeam\\/DNS-Data\\/NTWK323-CNAME-DNS.txt\",\"link\":\"\",\"index\":null,\"source\":\"files_external\",\"info\":[],\"hash\":\"7c08736aca02d9ea398d317ee6873508\",\"contentSize\":0,\"tags\":[],\"metatags\":[],\"subtags\":[],\"more\":[],\"excerpts\":[{\"source\":\"content\",\"excerpt\":\"rightfax 1200 CNAME srvr340.westchestergov.com.\"},{\"source\":\"content\",\"excerpt\":\"rightfaxconnector 300 CNAME exch235.westchestergov.com.\"}],\"score\":\"0\"},{\"id\":\"2702552\",\"providerId\":\"files\",\"access\":{\"ownerId\":\"\",\"viewerId\":\"cqcj\",\"users\":[],\"groups\":[],\"circles\":[],\"links\":[]},\"modifiedTime\":0,\"title\":\"Server\\/Procedures\\/Right Fax Docs\\/OLDRFDocs\\/RfDoitDocs\\/T1 Info.txt\",\"link\":\"\",\"index\":null,\"source\":\"files_group_folders\",\"info\":[],\"hash\":\"0c601201f1c8a13285f0de81f207611f\",\"contentSize\":0,\"tags\":[],\"metatags\":[],\"subtags\":[],\"more\":[],\"excerpts\":[{\"source\":\"content\",\"excerpt\":\"RightFax Circuit \\/ line: New 08HNXS1. The order # was XXXXXXXXX.\"}],\"score\":\"0\"},{\"id\":\"2702514\",\"providerId\":\"files\",\"access\":{\"ownerId\":\"\",\"viewerId\":\"cqcj\",\"users\":[],\"groups\":[],\"circles\":[],\"links\":[]},\"modifiedTime\":0,\"title\":\"Server\\/Procedures\\/Right Fax Docs\\/OLDRFDocs\\/TestProgram04 setup\\/d\\/VB\\/RF2VBAX-ReadMe.txt\",\"link\":\"\",\"index\":null,\"source\":\"files_group_folders\",\"info\":[],\"hash\":\"30a14df804cba889191775aa0d9b88ba\",\"contentSize\":0,\"tags\":[],\"metatags\":[],\"subtags\":[],\"more\":[],\"excerpts\":[{\"source\":\"content\",\"excerpt\":\"================ RF2VBAX is an ActiveX control that provides a simpler interface to the RightFAX VB\"}],\"score\":\"0\"}],\"info\":[],\"meta\":{\"timedOut\":false,\"time\":41,\"count\":4,\"total\":4,\"maxScore\":10}}]},{\"file\":\"\\/var\\/www\\/nextcloud\\/apps\\/fulltextsearch\\/lib\\/Service\\/SearchService.php\",\"line\":166,\"function\":\"searchFromProviders\",\"class\":\"OCA\\\\FullTextSearch\\\\Service\\\\SearchService\",\"type\":\"->\",\"args\":[{},[{}],{\"ownerId\":\"\",\"viewerId\":\"cqcj\",\"users\":[],\"groups\":[\"Architecture Committee\",\"UnixSystemsDocumentation\",\"WebAdmins\",\"admin\",\"it-eventidesupport\",\"Server Support\",\"IT-Dept\",\"UnixAdmins\"],\"circles\":[],\"links\":[]},{\"providers\":[\"all\"],\"author\":\"cqcj\",\"search\":\"rightfax\",\"empty_search\":false,\"page\":1,\"size\":10,\"parts\":[\"comments\"],\"queries\":[],\"options\":{\"files_local\":\"0\",\"files_external\":\"0\",\"files_group_folders\":\"0\",\"files_extension\":\"txt\"},\"metatags\":[],\"subtags\":[],\"tags\":[]}]},{\"file\":\"\\/var\\/www\\/nextcloud\\/apps\\/fulltextsearch\\/lib\\/Controller\\/ApiController.php\",\"line\":129,\"function\":\"search\",\"class\":\"OCA\\\\FullTextSearch\\\\Service\\\\SearchService\",\"type\":\"->\",\"args\":[\"cqcj\",{\"providers\":[\"all\"],\"author\":\"cqcj\",\"search\":\"rightfax\",\"empty_search\":false,\"page\":1,\"size\":10,\"parts\":[\"comments\"],\"queries\":[],\"options\":{\"files_local\":\"0\",\"files_external\":\"0\",\"files_group_folders\":\"0\",\"files_extension\":\"txt\"},\"metatags\":[],\"subtags\":[],\"tags\":[]}]},{\"file\":\"\\/var\\/www\\/nextcloud\\/apps\\/fulltextsearch\\/lib\\/Controller\\/ApiController.php\",\"line\":103,\"function\":\"searchDocuments\",\"class\":\"OCA\\\\FullTextSearch\\\\Controller\\\\ApiController\",\"type\":\"->\",\"args\":[{\"providers\":[\"all\"],\"author\":\"cqcj\",\"search\":\"rightfax\",\"empty_search\":false,\"page\":1,\"size\":10,\"parts\":[\"comments\"],\"queries\":[],\"options\":{\"files_local\":\"0\",\"files_external\":\"0\",\"files_group_folders\":\"0\",\"files_extension\":\"txt\"},\"metatags\":[],\"subtags\":[],\"tags\":[]}]},{\"file\":\"\\/var\\/www\\/nextcloud\\/lib\\/private\\/AppFramework\\/Http\\/Dispatcher.php\",\"line\":217,\"function\":\"search\",\"class\":\"OCA\\\\FullTextSearch\\\\Controller\\\\ApiController\",\"type\":\"->\",\"args\":[\"{\\\"providers\\\":\\\"all\\\",\\\"options\\\":{\\\"files_local\\\":\\\"0\\\",\\\"files_external\\\":\\\"0\\\",\\\"files_group_folders\\\":\\\"0\\\",\\\"files_extension\\\":\\\"txt\\\"},\\\"search\\\":\\\"rightfax\\\",\\\"page\\\":1}\"]},{\"file\":\"\\/var\\/www\\/nextcloud\\/lib\\/private\\/AppFramework\\/Http\\/Dispatcher.php\",\"line\":126,\"function\":\"executeController\",\"class\":\"OC\\\\AppFramework\\\\Http\\\\Dispatcher\",\"type\":\"->\",\"args\":[{},\"search\"]},{\"file\":\"\\/var\\/www\\/nextcloud\\/lib\\/private\\/AppFramework\\/App.php\",\"line\":156,\"function\":\"dispatch\",\"class\":\"OC\\\\AppFramework\\\\Http\\\\Dispatcher\",\"type\":\"->\",\"args\":[{},\"search\"]},{\"file\":\"\\/var\\/www\\/nextcloud\\/lib\\/private\\/Route\\/Router.php\",\"line\":301,\"function\":\"main\",\"class\":\"OC\\\\AppFramework\\\\App\",\"type\":\"::\",\"args\":[\"OCA\\\\FullTextSearch\\\\Controller\\\\ApiController\",\"search\",{},{\"_route\":\"fulltextsearch.Api.search\"}]},{\"file\":\"\\/var\\/www\\/nextcloud\\/lib\\/base.php\",\"line\":1000,\"function\":\"match\",\"class\":\"OC\\\\Route\\\\Router\",\"type\":\"->\",\"args\":[\"\\/apps\\/fulltextsearch\\/v1\\/search\"]},{\"file\":\"\\/var\\/www\\/nextcloud\\/index.php\",\"line\":36,\"function\":\"handleRequest\",\"class\":\"OC\",\"type\":\"::\",\"args\":[]}]",
"userAgent": "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0",
"version": "22.1.1.2"
}
when it called function "setDocumentInfo", it would throw a exception, and log to log.file.it's not a pretty way to handle it . hope author can change it.
apps->files_fulltextsearch->lib->Service->SearchService.php->improveSearchResult
The same error message now appears when a search is done in IOS client 4.4.x (which uses unified search) - breaking the search in the app completely. See #190
@ccandreva Does your searched file live in an external storage connected to your Nextcloud server?
@jacotec Yes, it's a cifs share.
OK ... so that is related. My issue #190 does also only occur if there is at least one result file on an external share.
From time to time I am getting the similar warning error, eg:
[files_fulltextsearch] Attention: Exception while improving searchresult: - trace: [{"file":"/var/www/html/nextcloud/apps/files_fulltextsearch/lib/Service/SearchService.php","line":272,"function":"getFileFromId","class":"OCA\Files_FullTextSearch\Service\FilesService","type":"->"},{"file":"/var/www/html/nextcloud/apps/files_fulltextsearch/lib/Service/SearchService.php","line":232,"function":"setDocumentInfo","class":"OCA\Files_FullTextSearch\Service\SearchService","type":"->"},{"file":"/var/www/html/nextcloud/apps/files_fulltextsearch/lib/Provider/FilesProvider.php","line":359,"function":"improveSearchResult","class":"OCA\Files_FullTextSearch\Service\SearchService","type":"->"},{"file":"/var/www/html/nextcloud/apps/fulltextsearch/lib/Service/SearchService.php","line":203,"function":"improveSearchResult","class":"OCA\Files_FullTextSearch\Provider\FilesProvider","type":"->"},{"file":"/var/www/html/nextcloud/apps/fulltextsearch/lib/Service/SearchService.php","line":166,"function":"searchFromProviders","class":"OCA\FullTextSearch\Service\SearchService","type":"->"},{"file":"/var/www/html/nextcloud/apps/fulltextsearch/lib/Search/UnifiedSearchProvider.php","line":139,"function":"search","class":"OCA\FullTextSearch\Service\SearchService","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/Search/SearchComposer.php","line":159,"function":"search","class":"OCA\FullTextSearch\Search\UnifiedSearchProvider","type":"->"},{"file":"/var/www/html/nextcloud/core/Controller/UnifiedSearchController.php","line":101,"function":"search","class":"OC\Search\SearchComposer","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":230,"function":"search","class":"OC\Core\Controller\UnifiedSearchController","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":137,"function":"executeController","class":"OC\AppFramework\Http\Dispatcher","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/AppFramework/App.php","line":183,"function":"dispatch","class":"OC\AppFramework\Http\Dispatcher","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\AppFramework\App","type":"::"},{"file":"/var/www/html/nextcloud/ocs/v1.php","line":64,"function":"match","class":"OC\Route\Router","type":"->"},{"file":"/var/www/html/nextcloud/ocs/v2.php","line":23,"args":["/var/www/html/nextcloud/ocs/v1.php"],"function":"require_once"}]
GET /ocs/v2.php/search/providers/fulltextsearch/search?term=%D0%A1%D0%BE&from=HIDDEN.pdf
The data resides in local storage.