fix: ensure folders at all levels are properly indexed in getChunksFr…#321
fix: ensure folders at all levels are properly indexed in getChunksFr…#321rolandinus wants to merge 2 commits intonextcloud:masterfrom
Conversation
…omDirectory Folders with level less than the FILES_CHUNK_SIZE were being recursed into but not added to the index themselves. Signed-off-by: Roland Scheidel <kontakt@scheidel.at>
|
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! (If you believe you should not receive this message, you can add yourself to the blocklist.) |
Just one line that fixes an issue where folders with level less than the configured FILES_CHUNK_SIZE were being recursed into but not added to the index themselves. It concerns the folder itself, not the files within, which are always properly indexed.
The current implementation only indexes folders beyond the configured FILES_CHUNK_SIZE level, but misses intermediate level folders. This creates inconsistent indexing behavior where some folders appear in search results and others don't, depending only on their depth in the directory structure.
How to reproduce
attention: top level folders are not added to the index even with this fix, this is a different issue
php occ fulltextsearch:document:platform files <fileid>, you will get an error:404 Not Found: {"_index":"nextcloud_31","_id":"files:1334","found":false}php occ fulltextsearch:index, the folder will be found.It is not a big issue, since the files are always indexed, still Folders should be added consistently to the index, independent of their level in the directory structure.