[Answer]-Django Haystack custom form custom attribute returns no results


super(MySearchForm, self).search() performs an auto_query() with a default field name of content… As you haven’t defined a field like this it will not return any results… Therefore I wouldn’t do the super call, but replace with an implementation similar to the original one – but pass a fieldname to auto_query: auto_query(querystring, fieldname='text').

Also make sure to have the template defined correctly if you are searching in it. (If you are chaining multiple filter() calls they will be combined usind and).

Also depending on the search engine you use it will probably offer you a frontend where you can check independently from haystack if the data is indexed properly…

Leave a comment