bgneal@223: """Haystack search index for the bio application.""" bgneal@753: from haystack import indexes bgneal@223: bgneal@223: from bio.models import UserProfile bgneal@943: from custom_search.fields import MaxTermSizeCharField bgneal@223: bgneal@223: bgneal@753: class UserProfileIndex(indexes.SearchIndex, indexes.Indexable): bgneal@943: text = MaxTermSizeCharField(document=True, use_template=True) bgneal@753: author = indexes.CharField(model_attr='user') bgneal@223: bgneal@753: def get_model(self): bgneal@753: return UserProfile bgneal@753: bgneal@753: def index_queryset(self, using=None): bgneal@223: return UserProfile.objects.filter(user__is_active=True) bgneal@223: bgneal@277: def get_updated_field(self): bgneal@277: return 'update_date'