Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support limit/offset in unified search #1618

Open
juliusknorr opened this issue Dec 19, 2024 · 1 comment
Open

Support limit/offset in unified search #1618

juliusknorr opened this issue Dec 19, 2024 · 1 comment
Labels
bug Something isn't working performance 🚀

Comments

@juliusknorr
Copy link
Member

As reported by @SystemKeeper the unified search providers seem to not properly support limiting and paginating the results.

I checked and the page content provider has some limit from the full text search index, but that is applied per collective, the other providers are just returning all results. We can probably do a quick fix to just skip results before the cursor and after the limit, but would still need to fetch most of the results in the backend. Otherwise we need to rethink the logic to collect search results.

Filing this issue to not forget

Talk PR for inspiration nextcloud/spreed#14024

@juliusknorr juliusknorr added bug Something isn't working performance 🚀 labels Dec 19, 2024
@github-project-automation github-project-automation bot moved this to 🧭 Planning evaluation (don't pick) in 📝 Office team Dec 19, 2024
@juliusknorr
Copy link
Member Author

This is also a performance issue with the smart picker on larger collectives.

The main issue is that we walk the directory tree in

$allPageInfos = $this->findAll($collectiveId, $userId);

We'd need to run a query directly towards the filecache there, but should be a lot faster to do something like:

select f.fileid, f.name from oc_filecache f LEFT JOIN oc_collectives_pages c ON f.fileid = c.file_id where storage = 2 AND path like 'appdata_ocacwrxokhrf/collectives/1/%' AND name like '%' LIMIT 5;

We probably should exclude Readme.md files as they would be covered already by the folder name.

Some similar query that could be reused, maybe making it more generic and moving it somewhere else.

$mimeTypeMd = $this->mimeTypeLoader->getId('text/markdown');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working performance 🚀
Projects
Status: 🧭 Planning evaluation (don't pick)
Development

No branches or pull requests

1 participant