Small question when storing multiple VectorIndecies. I create my indexes like this:
print("Creating index for filter 'procedures'...")
index_procedure = create_index_procedure()
index_procedure.set_index_id('procedure')
index_procedure.storage_context.persist()
print("Creating index for filter 'taxonomy'...")
index_taxonomy = create_index_taxonomy()
index_taxonomy.set_index_id('taxonomy')
index_taxonomy.storage_context.persist()
print("Creating index for filter 'state'...")
index_state = create_index_state()
index_state.set_index_id('state')
index_state.storage_context.persist()
The functions
create_index_**
all call an internal function that does:
# Create index
index = VectorStoreIndex.from_documents(
documents=documents,
storage_context=get_storage_context() # common storage context I resuse all over the app
)
Unfortunately, something seems to be wrong with the indeces, because when I try to load the data as such:
# Get storage context
storage_context = get_storage_context()
# Create indexes
index_procedure = load_index_from_storage(storage_context, 'procedure')
index_taxonomy = load_index_from_storage(storage_context, 'taxonomy')
index_state = load_index_from_storage(storage_context, 'state')
I get the reply
ValueError: Failed to load index with ID procedure