added changes from https://github.com/dulaccc/django-haystack/commit/fb6fe9615d0bd8b1fedb1c1211020f67de64ffde