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

15635 filter search results if deactivated plugin #15693

Closed
wants to merge 1 commit into from

Conversation

arthanson
Copy link
Collaborator

Fixes: #15635

Update search to exclude any records which refer to an instance of a model that's no longer installed. This can happen when a plugin is removed but its data remains in the database, for example.

@arthanson arthanson marked this pull request as ready for review April 10, 2024 22:37
@arthanson arthanson requested a review from jeremystretch April 10, 2024 22:37
# Construct the base queryset to retrieve matching results
queryset = CachedValue.objects.filter(query_filter).annotate(
queryset = CachedValue.objects.filter(object_type_id__in=content_type_ids).filter(query_filter).annotate(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This introduces significant overhead to the query. We should explore options for a more elegant approach, which will probably entail prescribing a process for clearing cached values for plugins that have been removed.

@arthanson
Copy link
Collaborator Author

Closing as fixed by documentation change

@arthanson arthanson closed this Apr 18, 2024
@arthanson arthanson deleted the 15635-search-deactivated-plugin branch April 18, 2024 15:59
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Server error when searching with global search and deactivated plugin
2 participants