def _question_suggestions(searcher, text, locale, product, max_results):
    if max_results <= 0:
        return []

    search_filter = es_utils.F(
        model='questions_question',
        question_is_archived=False,
        question_is_locked=False,
        question_is_solved=True)
    if product:
        search_filter &= es_utils.F(product=product)
    if locale:
        search_filter &= es_utils.F(question_locale=locale)

    questions = []
    searcher = _query(searcher, QuestionMappingType, search_filter, text, locale)

    question_ids = [result['id'] for result in searcher[:max_results]]
    questions = [
        QuestionSerializer(instance=q).data
        for q in Question.objects.filter(id__in=question_ids)
    ]

    return questions
dataset/ETHPy150Open mozilla/kitsune/kitsune/search/api.py/_question_suggestions/original