Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
adityasa committed Nov 1, 2024
1 parent dc05a71 commit d42149f
Showing 1 changed file with 26 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,6 @@ public class HybridRankingQueryTests
{
private CosmosClient CreateCosmosClient(bool local)
{
return local ?
new CosmosClient(
"https://localhost:8081",
"") :
new CosmosClient(
"https://hybridranktest.documents.azure.com:443/",
"",
new CosmosClientOptions() { ConnectionMode = ConnectionMode.Gateway });
}

[TestMethod]
Expand Down Expand Up @@ -69,6 +61,32 @@ await databaseForVectorEmbedding.DefineContainer(containerName, partitionKeyPath
Assert.AreEqual(fullTextPath1, containerSettings.IndexingPolicy.FullTextIndexes[0].Path);
}

[TestMethod]
public async Task CreatePolicyAndIdnexOnExistingContainer()
{
string path = "/abstract";
CosmosClient client = this.CreateCosmosClient(local: false);
Container container = client.GetContainer("HybridRankTesting", "arxiv-250kdocuments-index");
ContainerResponse response = await container.ReadContainerAsync();
ContainerProperties containerProperties = response.Resource;
containerProperties.FullTextPolicy = new FullTextPolicy
{
DefaultLanguage = "en-US",
FullTextPaths = new Collection<FullTextPath>
{
new FullTextPath
{
Path = path,
Language = "en-US",
}
}
};
containerProperties.IndexingPolicy.FullTextIndexes.Add(new FullTextIndexPath { Path = path });

ContainerResponse containerResponse = await container.ReplaceContainerAsync(containerProperties);
Assert.IsTrue(containerResponse.StatusCode == HttpStatusCode.OK);
}

[TestMethod]
public async Task CreateCollectionBothPolicyAndIndex()
{
Expand Down

0 comments on commit d42149f

Please sign in to comment.