def _get_latest_index(config: Config, index_name: str) -> MarqoIndex:
    """
    Get index from the cache first. If index is semi-structured, get the latest setting bypassing the cache
    This approach makes sure we don't add extra latency to structured indexes or legacy unstructured indexes since they
    never change. It also makes sure we always get the latest version of semi-structured index to guarantee the strong
    consistency.
    """
    marqo_index = index_meta_cache.get_index(index_management=config.index_management, index_name=index_name)
    if marqo_index.type == IndexType.SemiStructured:
        return config.index_management.get_index(index_name=index_name)
    return marqo_index

    Get index from the cache first. If index is semi-structured, get the latest setting bypassing the cache
    This approach makes sure we don't add extra latency to structured indexes or legacy unstructured indexes since they
    never change. It also makes sure we always get the latest version of semi-structured index to guarantee the strong
    consistency.
    
src/marqo/tensor_search/tensor_search.py