'Applies all fillters and prefetches and constructs SearchQuery and
SearchResult objects.'

def search(self, query_string, model_or_queryset, fields=None, filters=None, prefetch_related=None, operator=None, order_by_relevance=True):

    if isinstance(model_or_queryset, QuerySet):
        model = model_or_queryset.model
        queryset = model_or_queryset
    else:
        model = model_or_queryset
        queryset = model_or_queryset.objects.all()
    if (query_string == u''):
        return []
    if fields:
        allowed_fields = {field.field_name for field in model.get_searchable_search_fields()}
        for field_name in fields:
            if (field_name not in allowed_fields):
                raise FieldError(((((((u'Cannot    search    with    field    "' + field_name) + u'".    Please    add    index.SearchField(\'') + field_name) + u"')    to    ") + model.__name__) + u'.search_fields.'))
    if filters:
        queryset = queryset.filter(**filters)
    if prefetch_related:
        for prefetch in prefetch_related:
            queryset = queryset.prefetch_related(prefetch)
    if (operator is not None):
        operator = operator.lower()
        if (operator not in [u'or', u'and']):
            raise ValueError(u"operator    must    be    either    'or'    or    'and'")
    search_query = self.query_class(queryset, query_string, fields=fields, operator=operator, order_by_relevance=order_by_relevance)
    return self.results_class(self, search_query)
