def METHOD_NAME(self):
    """
    Returns an Elasticsearch DSL search object or an iterator.
    .. note::
       Calling ``list(search)`` over an DSL search object is the same as
       calling ``search.execute().hits``. This is why an DSL search object
       is compatible with DRF's paginator.
    """
    projects = {
        project.slug: version.slug
        for project, version in self._get_projects_to_search()
    }
    # Check to avoid searching all projects in case it's empty.
    if not projects:
        log.info("Unable to find a version to search")
        return []
    query = self._get_search_query()
    queryset = PageSearch(
        query=query,
        projects=projects,
        aggregate_results=False,
        use_advanced_query=self._use_advanced_query(),
    )
    return queryset