Fixed Django Admin integration for Haystack with Whoosh

Internet Apps django haystack whoosh

Source i (link to git-repo or to original if based on someone elses unmodified work):

https://www.opencode.net/ugnvs/fixed-django-admin-integration-for-haystack-with-whoosh

0
Become a Fan
5.0

Available as/for:
Description:
The problem

Django is a very attractive tool to rapidly create (relatively) small in-house web-applications with default autogenerated Django Admin user interface. Sooner or later one feels that default Django Admin search capabilities are somewhat limited and something like full-text search could be more desirable. Installing Haystack with Whoosh backend seems to be an optimal solution for such small applications.
Unfortunately, Haystack with Whoosh integration module spoils Django Admin user interface and makes search results list virtually useless. Namely, after one performs full-text search

- Django Admin left navigation panel disappears.
- Column sorting no longer works in Django Admin table view.
- Row selection column disappears from Django Admin table view.
- Action selection menu becomes unavailable.
- Whoosh wildcard search does not work.

The fix

Let's assume that one has installed Django, Haystack and Whoosh in a virtual environment in ~/code/django.venv directory.

Module ~/code/django.venv/lib/python3.10/site-packages/haystack/admin.py has to be replaced with admin.py file from this project.
Edit module ~/code/django.venv/ lib/ python3.10 /site-packages/ haystack/ backends/ whoosh_backend.py. Look for WhooshSearchBackend class definition circa lines 99, 100 and comment out lines with "*" and "?"

Good luck!

Ratings & Comments

0 Comments

Be the first to comment
Pling
0 Affiliates
Details
license MIT License
version
updated
added
downloads 24h 0
mediaviews 24h 0
pageviews 24h 2

Other Internet Apps:

twoline
Ignotus
last update date: 12 years ago

Score 5.0

Kompas
mosra
last update date: 14 years ago

Score 6.1

Orion
fjorst
last update date: 8 years ago

Score 5.7

FlatSiteBuilder
Artanidos
last update date: 3 years ago

Score 5.0

Sendanywhere
abishek
last update date: 7 years ago

Score 5.0

Nextcloud Desktop Client
AJSlye
last update date: 4 years ago

Score 5.5