Reputation: 29767
I am going through the haystack tutorial and have built the following directory structure for the search text file:
My search_indexes.py looks like the following:
class FoodIndex(indexes.SearchIndex, indexes.Indexable):
text = indexes.CharField(document=True, use_template=True)
name = indexes.CharField(model_attr='name')
def get_model(self):
return Food
def index_queryset(self, using=None):
"""Used when the entire index for model is updated."""
return self.get_model().objects.all()
When issue the command manage.py rebuild_index with the default backend from haystack it builds the index no problem. When I issue the command connected to my solr backend, I get the following error:
django.template.base.TemplateDoesNotExist: search/indexes/nutrition/food_text.txt
How can I have the index successfully build with Solr like it does with the default backend?
Upvotes: 0
Views: 954
Reputation: 29767
thanks @karthikr . I had the wrong directory structure. It should be this:
Upvotes: 2