Atma
Atma

Reputation: 29767

template does not exist error when using solr with django haystack

I am going through the haystack tutorial and have built the following directory structure for the search text file:

enter image description here

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

Answers (1)

Atma
Atma

Reputation: 29767

thanks @karthikr . I had the wrong directory structure. It should be this:

enter image description here

Upvotes: 2

Related Questions