Opened 15 years ago
Last modified 8 months ago
#13033 new New feature
MySQL full text search in admin
Reported by: | Simon Litchfield | Owned by: | nobody |
---|---|---|---|
Component: | contrib.admin | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Joseph Gordon, Adam Zapletal | Triage Stage: | Accepted |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Full text search hasn't been implemented properly in admin. The query is being word split and OR'd like regular fields.
Attached patch fixes this, allowing you to type in any mysql boolean search.
Simply prefix your admin search_fields with @ to use, eg ('@myfield', ).
Be sure to include ALL the fields you have included in your index, else mysql might not use the full text index and instead default back to running a standard LIKE query.
BTW, I can't recall the various search_field operators mentioned in docs?
Attachments (1)
Change History (13)
by , 15 years ago
Attachment: | admin-fulltext-12288.diff added |
---|
comment:1 by , 15 years ago
comment:2 by , 15 years ago
Triage Stage: | Unreviewed → Accepted |
---|
This isn't a bug fix -- there is nothing in the docs that says that search_fields allows full boolean searches. However, given that we're exposing MySQL Fulltext indexes, it makes sense that we should support them.
comment:3 by , 14 years ago
Type: | → New feature |
---|
comment:4 by , 14 years ago
Severity: | → Normal |
---|
comment:5 by , 14 years ago
Needs documentation: | set |
---|---|
Needs tests: | set |
comment:9 by , 9 years ago
Cc: | added |
---|
follow-up: 11 comment:10 by , 9 years ago
Has patch: | unset |
---|---|
Needs documentation: | unset |
Needs tests: | unset |
This is already implemented - https://github.com/django/django/blob/917cc288a38f3c114a5440f0749b7e5e1086eb36/django/contrib/admin/options.py#L888.
I believe ticket could be closed.
comment:11 by , 8 months ago
Replying to Sasha Gaevsky:
This is already implemented - https://github.com/django/django/blob/917cc288a38f3c114a5440f0749b7e5e1086eb36/django/contrib/admin/options.py#L888.
I believe ticket could be closed.
It looks like the __search
lookup is only implemented for Postgres (in contrib.postgres
): https://docs.djangoproject.com/en/dev/ref/contrib/postgres/search/#std-fieldlookup-search
There is currently no contrib.mysql
. Is this level of MySQL-specific behavior of interest to Django?
comment:12 by , 8 months ago
Cc: | added |
---|
To clarify, this was already half implemented. This finishes the job. So isn't really a new feature, just a fix :-)