Avatar ·

Search by substring in django + haystack + Whoosh

📁 Advanced Python Topics, work

There is a certain model. It stores movie titles. Here is the index class:

from haystack import indexesfrom kino.films.models import Filmsclass FilmsIndex(indexes.SearchIndex, indexes.Indexable):    text = indexes.CharField(document=True, use_template=True)    rusname = indexes.CharField(model_attr='rusname')    origname = indexes.CharField(model_attr='origname')    year = indexes.IntegerField(model_attr='year')    def get_model(self)