(query)
return results
Search for podcasts according to 'query
Search for podcasts according to 'query
Search for podcasts according to query
def search_podcasts(query):
    """Search for podcasts according to 'query'"""
    if is_query_too_short(query):
        logger.debug('Found no podcasts for "{query}". Query is too short', query=query)
        return Podcast.objects.none()

    logger.debug('Searching for "{query}" podcasts"', query=query)

    query = SearchQuery(query)

    results = (
        Podcast.objects.annotate(rank=SearchRank(F("search_vector"), query))
        .annotate(
            order=ExpressionWrapper(
                F("rank") * F("subscribers"), output_field=FloatField()
            )
        )
        .filter(rank__gte=SEARCH_CUTOFF)
        .order_by("-order")[:100]
        .prefetch_related("slugs")
    )

    logger.debug(
        'Found {count} podcasts for "{query}"', count=len(results), query=query
    )

    return results
def search_podcasts ( query ) : if is_query_too_short ( query ) : logger . debug ( 'Found no podcasts for "{query}". Query is too short' , query = query ) return Podcast . objects . none ( ) logger . debug ( 'Searching for "{query}" podcasts"' , query = query ) query = SearchQuery ( query ) results = ( Podcast . objects . annotate ( rank = SearchRank ( F ( "search_vector" ) , query ) ) . annotate ( order = ExpressionWrapper ( F ( "rank" ) * F ( "subscribers" ) , output_field = FloatField ( ) ) ) . filter ( rank__gte = SEARCH_CUTOFF ) . order_by ( "-order" ) [ : 100 ] . prefetch_related ( "slugs" ) ) logger . debug ( 'Found {count} podcasts for "{query}"' , count = len ( results ) , query = query ) return results