Skip to content

Instantly share code, notes, and snippets.

@mcroydon
Created February 25, 2010 15:32
Show Gist options
  • Save mcroydon/314633 to your computer and use it in GitHub Desktop.
Save mcroydon/314633 to your computer and use it in GitHub Desktop.
from haystack.indexes import *
from haystack import site
from publications.models import Publication
class PublicationIndex(SearchIndex):
text = CharField(document=True, use_template=True)
author = MultiValueField()
def prepare_author(self, obj):
return [unicode(a) for a in obj.authors.all()]
site.register(Publication, PublicationIndex)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment