def search(self, *args, **kwargs):
    "\n        Proxy to queryset's search method for the manager's model and\n        any models that subclass from this manager's model if the\n        model is abstract.\n        "
    if (not settings.SEARCH_MODEL_CHOICES):
        models = [m for m in get_models() if issubclass(m, self.model)]
        parents = reduce(ior, [m._meta.get_parent_list() for m in models])
        models = [m for m in models if (m not in parents)]
    elif getattr(self.model._meta, 'abstract', False):
        search_choices = set()
        models = set()
        parents = set()
        errors = []
        for name in settings.SEARCH_MODEL_CHOICES:
            try:
                model = get_model(*name.split('.', 1))
            except LookupError:
                errors.append(name)
            else:
                search_choices.add(model)
        if errors:
            raise ImproperlyConfigured(("Could not load the model(s) %s defined in the 'SEARCH_MODEL_CHOICES' setting." % ', '.join(errors)))
        for model in get_models():
            is_subclass = issubclass(model, self.model)
            this_parents = set(model._meta.get_parent_list())
            in_choices = ((not search_choices) or (model in search_choices))
            in_choices = (in_choices or (this_parents & search_choices))
            if (is_subclass and (in_choices or (not search_choices))):
                models.add(model)
                parents.update(this_parents)
        models -= parents
    else:
        models = [self.model]
    all_results = []
    user = kwargs.pop('for_user', None)
    for model in models:
        try:
            queryset = model.objects.published(for_user=user)
        except AttributeError:
            queryset = model.objects.get_queryset()
        all_results.extend(queryset.search(*args, **kwargs))
    return sorted(all_results, key=(lambda r: r.result_count), reverse=True)
Proxy to queryset's search method for the manager's model and
any models that subclass from this manager's model if the
model is abstract.
def search(self, *args, **kwargs):
    "\n        Proxy to queryset's search method for the manager's model and\n        any models that subclass from this manager's model if the\n        model is abstract.\n        "
    if (not settings.SEARCH_MODEL_CHOICES):
        models = [m for m in get_models() if issubclass(m, self.model)]
        parents = reduce(ior, [m._meta.get_parent_list() for m in models])
        models = [m for m in models if (m not in parents)]
    elif getattr(self.model._meta, 'abstract', False):
        search_choices = set()
        models = set()
        parents = set()
        errors = []
        for name in settings.SEARCH_MODEL_CHOICES:
            try:
                model = get_model(*name.split('.', 1))
            except LookupError:
                errors.append(name)
            else:
                search_choices.add(model)
        if errors:
            raise ImproperlyConfigured(("Could not load the model(s) %s defined in the 'SEARCH_MODEL_CHOICES' setting." % ', '.join(errors)))
        for model in get_models():
            is_subclass = issubclass(model, self.model)
            this_parents = set(model._meta.get_parent_list())
            in_choices = ((not search_choices) or (model in search_choices))
            in_choices = (in_choices or (this_parents & search_choices))
            if (is_subclass and (in_choices or (not search_choices))):
                models.add(model)
                parents.update(this_parents)
        models -= parents
    else:
        models = [self.model]
    all_results = []
    user = kwargs.pop('for_user', None)
    for model in models:
        try:
            queryset = model.objects.published(for_user=user)
        except AttributeError:
            queryset = model.objects.get_queryset()
        all_results.extend(queryset.search(*args, **kwargs))
    return sorted(all_results, key=(lambda r: r.result_count), reverse=True)