'''
Created on May 30, 2011

@author: ymh
'''

#from haystack import site
#from haystack.indexes import SearchIndex, CharField
from haystack import indexes
from hdabo.models import Datasheet

class DatasheetIndex(indexes.SearchIndex, indexes.Indexable):
    '''
    The search index for the datasheet
    '''
    text = indexes.CharField(document=True, use_template=True)
    hda_id = indexes.CharField(model_attr='hda_id', indexed=True, stored=True)
    title = indexes.CharField(model_attr='title', indexed=True, stored=True, boost=2.0)
    description = indexes.CharField(model_attr='description', indexed=True, stored=True, boost=1.0)
    
    def get_model(self):
        return Datasheet

#site.register(Datasheet, DatasheetIndex)
