no result are found - haystack django whoosh
I have a huge problem!
I am using haystack and whoos开发者_如何学Ch and django. I am sure I've done everything that is required to be done to make it works according to the documentation.
BUT!!!! results of searching are: "no results found" all the time. But if symbols I put into the form are spaces, every objects I've indexed are printed
Details:
In my search_indexes.py I have:
from haystack.indexes import *
from haystack import site
from aias.models import Uspd
class UspdIndex(SearchIndex):
text = CharField(document=True, use_template=True)
serial = CharField(model_attr = 'serial')
type_id = IntegerField(model_attr = 'type_id')
name = CharField(model_attr = 'name')
def get_queryset(self):
return Uspd.objects.all()
site.register(Uspd, UspdIndex)
I've created template in folder folder_where_I_have_templates/search/indexes/name_of_my_applcation
and printed
{{ object.type_id }}
{{ object.name }}
{{ object.serial }}
there.
By the way I did
>>> from haystack.query import SearchQuerySet
>>> sqs = SearchQuerySet().all()
>>> sqs.count()
And result was 0 What the hell is going on????
Help me please!
You haven't mentioned what the search document is called. It should be: uspd_text.txt
The doco said:
You’ll need to create a new template inside your template directory called search/indexes/myapp/note_text.txt and place the following inside
精彩评论