@classmethod
def count(cls, query=None, myindex=None):
    """Get the total of records. Return the count only.

    query: dict to request on specific result
    myindex: str example: pictures,albums <--- no space between the values

    return: number of result

    """
    conn = cls.get_connection()
    if query:
        query['size'] = 0
    else:
        query = {'query': {'match_all': {}}, 'size': 0}
    if not myindex:
        myindex = cls.get_index_name()
    result = conn.search(index=myindex, body=query)
    return result['hits']['total']
