-
Notifications
You must be signed in to change notification settings - Fork 267
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
Fix admin search slow #1750
Fix admin search slow #1750
Conversation
1bac157
to
db9a621
Compare
- Implement new AdvancedAdminSearchMixin - Don't convert every value to text for search, so DB indexes can be used - Change admin search from `iexact (=)` to `exact (==)`
db9a621
to
95c3fe3
Compare
""" | ||
|
||
# Apply keyword searches. | ||
print("HOLA") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello!
@@ -26,7 +26,6 @@ class SafeMessageConfirmationAdmin(BinarySearchAdmin): | |||
list_select_related = ("safe_message",) | |||
ordering = ["-created"] | |||
search_fields = [ | |||
"=safe_message__safe", | |||
"=owner", | |||
"safe_message__description", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
description
was removed from filter, are you aware of this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it was not posible to search for text when using a JOIN, so there was an error here
- Implement new AdvancedAdminSearchMixin - Don't convert every value to text for search, so DB indexes can be used - Change admin search from `iexact (=)` to `exact (==)`
8edbf47
to
363715c
Compare
iexact (=)
toexact (==)