#12033 closed New feature (wontfix)
ModelAdmin.search_fields throws exception when using @ for non mysql database
| Reported by: | Harro | Owned by: | nobody |
|---|---|---|---|
| Component: | contrib.admin | Version: | 1.1 |
| Severity: | Normal | Keywords: | search_fields, fulltext, mysql, sqlite, error |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
So for the production environment I would really like to use the fulltext search capabilities the @ prefix offers, but for development we hardly use the search anyway. And most people will use sqlite anyway.
Django throwing an exception when using the @ option for a non mysql backend makes it impossible to keep your code the same.
I suggest when using @ for a non mysql backend django throws an error in the error log and the normal search is used.
Change History (5)
comment:1 by , 16 years ago
| Triage Stage: | Unreviewed → Accepted |
|---|
comment:2 by , 15 years ago
| Severity: | → Normal |
|---|---|
| Type: | → New feature |
comment:3 by , 14 years ago
| Easy pickings: | unset |
|---|---|
| UI/UX: | unset |
comment:6 by , 9 years ago
| Resolution: | → wontfix |
|---|---|
| Status: | new → closed |
The MySQL specific __search lookup and its @ search field reference have been deprecated.
It's now possible to override the ModelAdmin.get_search_results() to provide backend agnostic FTS.
comment:7 by , 9 years ago
Actually the @ -> __search conversion is still present in get_search_result() so could implement a SearchLookup that you register to both CharField and TextField and you could implement it on SQLite.
Note that full-text search will work in backends other than MySQL if they implement
fulltext_search_sql, which is the topic of #3254.