old_contents: from haystack.indexes import *
  from haystack import site
  from models import Article
  
  class ArticleIndex(SearchIndex):
      name = CharField(model_attr='title')
      text = CharField(document=True, use_template=True)
  
      def get_queryset(self):
          """Used when the entire index for model is updated."""
          return Article.objects.active()
  
  site.register(Article, ArticleIndex)
  
  
new_contents: from haystack import indexes
  from models import Article
  
  
  class ArticleIndex(indexes.SearchIndex):
      name = indexes.CharField(model_attr='title')
      text = indexes.CharField(document=True, use_template=True)
  
      def get_queryset(self):
          """Used when the entire index for model is updated."""
          return Article.objects.active()
  
  
  # In haystack < 2.0 we need to explicitly register indexes
  try:
      from haystack import site
  except ImportError:
      pass
  else:
      site.register(Article, ArticleIndex)
  
subject: Support haystack version 2.