Not super clear if I can do this:
# build original index
service_context = create_service_context(included_metadata_extactors=False)
index = VectorStoreIndex.from_documents(
documents, storage_context=storage_context, service_context=service_context, show_progress=True
)
# change the service context to now include metadata extractors and refresh the index to act on any updates.
service_context = create_service_context(include_metadata_extractors=True)
index.refresh(documents, service_context=service_context)
It looks like refresh only changes if the text changes...