I am trying to implement compliant results to search only for a part of a word (which is called autocomplete according to the Haystack docs, if I'm not mistaken).
Example:
Search "gol"
Result of "goldfish"
What have i tried?
I did as I set the documents in step 1 , I added the following line to my Index class:
content_auto = indexes.EdgeNgramField(model_attr='content')
Then did python manage.py rebuild_index .
Index recovery, however, caused the haystack.exceptions.SearchFieldError: The model '<Person: Reginald>' does not have a model_attr 'content'. With Reginald was the first entry in my indexed table and Person , which was indexed by the model.
Now my model does not have a field called content , but as shown in the docs, it should not have such a field.
I am using Whoosh 2.4.1 , Django-haystack 1.2.7 and Django 1.4 .
source share