def METHOD_NAME(samples, search, user, previous_search_results, genome_version, sort=None, page=1, num_results=100,
                      gene_agg=False, **kwargs):
    end_offset = num_results * page
    search_body = _format_search_body(samples, genome_version, end_offset, search)
    frequencies = search_body.pop('freqs', None)
    if frequencies and frequencies.get('callset'):
        frequencies['seqr'] = frequencies.pop('callset')
    search_body.update({
        'sort': sort,
        'sort_metadata': _get_sort_metadata(sort, samples),
        'frequencies': frequencies,
        'quality_filter': search_body.pop('qualityFilter', None),
        'custom_query': search_body.pop('customQuery', None),
    })
    search_body.pop('skipped_samples', None)
    _parse_location_search(search_body)
    path = 'gene_counts' if gene_agg else 'search'
    response_json = _execute_search(search_body, user, path)
    if gene_agg:
        previous_search_results['gene_aggs'] = response_json
        return response_json
    previous_search_results['total_results'] = response_json['total']
    previous_search_results['all_results'] = response_json['results']
    return response_json['results'][end_offset - num_results:end_offset]