I am following this tutorial about taking advantage of Azure Cosmos DB for Mongo DB vCore's vector similarity search functionality. To do so, I created a Cosmos DB resource using "Try Azure Cosmos DB" with a resource group located in East US.
I connected to the database using this connection string:
However, using that raises an exception "ConfigurationError: The DNS query name does not exist: _mongodb._tcp.cosmosrgeastus318282c5-ac03-48af-82f4db.mongo.cosmos.azure.com."
That is why I changed it to the actual connection string provided by the Azure CosmosDB resource alongside the user, password and server values.
Then I created a database and a collection
# create a database called TutorialDB
db = mongo_client['TutorialDB']
# Create collection if it doesn't exist
COLLECTION_NAME = "CarrierManualCollection"
collection = db[COLLECTION_NAME]
if COLLECTION_NAME not in db.list_collection_names():
# Creates a unsharded collection that uses the DBs shared throughput
db.create_collection(COLLECTION_NAME)
print("Created collection '{}'.\n".format(COLLECTION_NAME))
else:
print("Using collection: '{}'.\n".format(COLLECTION_NAME))
Which results as expected printing Created collection 'CarrierManualCollection'.
Then, I try to create an IVF index, since "IVF is supported on all cluster tiers, including the free tier".
It seems like the IVF index is only supported by the vCore version of Azure Cosmos DB Mongo DB, and since I am using the free trial (RU version) the operation is not supported.
I am following this tutorial about taking advantage of Azure Cosmos DB for Mongo DB vCore's vector similarity search functionality. To do so, I created a Cosmos DB resource using "Try Azure Cosmos DB" with a resource group located in East US.
I connected to the database using this connection string:
Despite a warning ("You appear to be connected to a CosmosDB cluster"), the client seems to be created successfully.
Note: According to the tutorial, the connection string is supposed to be
However, using that raises an exception "ConfigurationError: The DNS query name does not exist: _mongodb._tcp.cosmosrgeastus318282c5-ac03-48af-82f4db.mongo.cosmos.azure.com." That is why I changed it to the actual connection string provided by the Azure CosmosDB resource alongside the user, password and server values.
Then I created a database and a collection
Which results as expected printing Created collection 'CarrierManualCollection'.
Then, I try to create an IVF index, since "IVF is supported on all cluster tiers, including the free tier".
But I got this error message:
OperationFailure: cosmosSearchOptions, full error: {'ok': 0.0, 'errmsg': 'cosmosSearchOptions', 'code': 197, 'codeName': 'InvalidIndexSpecificationOption'}
The expected behavior is to get a success message that allows me to continue with the tutorial adding data to the collection.
What am I missing?