示例#1
0
class FakeSearch(search.ModelSearchAdapter):
    model = Fake
    fields = [
        'title^2',
        'description',
    ]
    facets = {
        'tag': search.TermFacet('tags'),
        'other': search.TermFacet('other'),
        'range': search.RangeFacet('a_num_field'),
        'daterange': search.DateRangeFacet('a_daterange_field'),
        'bool': search.BoolFacet('boolean'),
        'extra': search.ExtrasFacet('extras'),
    }
    sorts = {
        'title': search.Sort('title.raw'),
        'description': search.Sort('description.raw'),
    }
示例#2
0
 def setUp(self):
     self.facet = search.DateRangeFacet('some_field')