from djapian import space, Indexer, CompositeIndexer

from darkroom.models import Photo


class PhotoIndexer(Indexer):
    tags = [
        ("title", "title"),
    ]
    fields = ["description"]


space.add_index(Photo, PhotoIndexer, attach_as="indexer")

complete_indexer = CompositeIndexer(Photo.indexer)
