def get_current_index(es, indexname):
    """
    Return the current complete index name base upon the configured base index name.

    Args:
        es: elasticsearch instance
        indexname (str): base index name

    Returns:
        str: complete index name
    """
    indices = es.indices.resolve_index(indexname + "*")["indices"]
    index_names = [index["name"] for index in indices]

    if len(indices) > 0:
        index_numbers = [int(index.split("-")[1]) for index in index_names]
        current_index = max(index_numbers)
        return indexname + "-" + f"{current_index:05d}"
    else:
        return None