fix: ensure folders at all levels are properly indexed in getChunksFr… #321
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.