Skip to content

Conversation

@rolandinus
Copy link

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

  1. Find a folder with the required condition (for default settings, a folder on level 2) ) and get its fileid.
    attention: top level folders are not added to the index even with this fix, this is a different issue
  2. Check with php occ fulltextsearch:document:platform files <fileid>, you will get an error:
    404 Not Found: {"_index":"nextcloud_31","_id":"files:1334","found":false}
  3. After applying the fix and running 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.

rolandinus and others added 2 commits May 1, 2025 16:11
…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>
@github-actions
Copy link

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

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.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant