Skip to content

Instantly share code, notes, and snippets.

@paulorsbrito
paulorsbrito / search_backends.py
Last active December 25, 2015 07:28 — forked from gregplaysguitar/folding_whoosh_backend.py
This is a fork of Greg's gist, which allows use of character folding with haystack and whoosh. What I've done was to add allow EdgeNGram fields to be folded. This is useful if you're using autocomplete or just indexing text as EdgeNGram field to allow partial keywork search. Thanks, Greg. Have fun.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This is a fork of Greg's gist, which allows use of character folding with haystack and whoosh. What
I've done was to add allow EdgeNGram fields to be folded. This is useful if you're using autocomplete
or just indexing text as EdgeNGram field to allow partial keywork search. Thanks, Greg. Have fun.
-+- original comments -+
https://gist.github.com/gregplaysguitar/1727204