def format_fuzzy_result(es_result):
    """
    format the es search result to front end processable format

    @param es_result: the es search result
    @type es_result: dict
    @return: the front end processable format, while will be like this::
        [{'compound_id': id, 'name': name},...]
    @rtype: list
    """

    compound_result = es_result['hits']['hits']
    result = list()
    if len(compound_result) != 0:
        for compound_item in compound_result:
            info = compound_item['_source']
            compound_info = {
                'compound_id': info["compound_id"],
                'name': info['name'],
            }
            result.append(compound_info)
    return result