fromdjango.utilsimporttimezonefromhaystackimportindexesfrom.modelsimportNoteclassNoteIndex(indexes.SearchIndex,indexes.Indexable):text=indexes.CharField(document=True,use_template=True)title=indexes.CharField(model_attr='title')body=indexes.CharField(model_attr='body')defget_model(self):returnNotedefindex_queryset(self,using=None):"""Used when the entire index for model is updated."""returnself.get_model().objects.filter(timestamp__lte=timezone.now())

This was a little bit confusing for me.
The text field here is the most important. All You want to be available for search should be here.
I want to search by Note.title and Note.body. To add them to the text field, I need to edit notes_text.txt.
Let's create it.

Elsticsearch has a beautiful http rest api. I don't see any benefits in using haystack, just talk to elasticsearch directly using your favourite http client.
Read Elasticsearch: The Definitive Guide first.