Skip to content

Commit 1a8397e

Browse files
authored
Cosmosdb/update sdk (Azure#34313)
### Packages impacted by this PR @azure/cosmos ### Issues associated with this PR ### Describe the problem that is addressed by this PR This PR contains the following changes: 1. Update ChangeLog for v4.4.0 release. 2. Update SDK release version. 3. Add samples for weighted RRF and disabling Hybrid search query plan optimization. ### What are the possible designs available to address the problem? If there are more than one possible design, why was the one in this PR chosen? ### Are there test cases added in this PR? _(If not, why?)_ N/A ### Provide a list of related PRs _(if any)_ ### Command used to generate this PR:**_(Applicable only to SDK release request PRs)_ ### Checklists - [ ] Added impacted package name to the issue description - [ ] Does this PR needs any fixes in the SDK Generator?** _(If so, create an Issue in the [Autorest/typescript](https://github.com/Azure/autorest.typescript) repository and link it here)_ - [ ] Added a changelog (if necessary)
1 parent 453eb7c commit 1a8397e

File tree

6 files changed

+85
-2
lines changed

6 files changed

+85
-2
lines changed

sdk/cosmosdb/cosmos/CHANGELOG.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,47 @@
11
<!-- dev-tool snippets ignore -->
22

33
# Release History
4+
## 4.4.0 (2025-05-13)
5+
6+
### Features Added
7+
#### New Bulk API
8+
The new `executeBulkOperations` API in the SDK brings significant enhancements for bulk workloads. It removes the previous 100-operation limit, adds operation-level retries for improved resilience, and introduces dynamic congestion control to optimize performance based on real-time system feedback.
9+
10+
Example of using `executeBulkOperations`:
11+
```js
12+
const operations: OperationInput[] = [
13+
{
14+
operationType: BulkOperationType.Create,
15+
partitionKey: "pkValue1",
16+
resourceBody: { id: "doc1", name: "sample1", key: "key1" },
17+
},
18+
{
19+
operationType: BulkOperationType.Create,
20+
partitionKey: "pkValue2",
21+
resourceBody: { id: "doc2", name: "sample2", key: "key1" },
22+
},
23+
// ...more operations
24+
];
25+
const response = await container.items.executeBulkOperations(
26+
operations,
27+
);
28+
// process the response
29+
```
30+
31+
#### Weighted RRF
32+
Adds WeightedRankFusion query feature and support of component weights for weighted rank fusion in Hybrid Search.
33+
34+
#### Optimized query plan that skips the order by rewrite
35+
Adds support for the optimized query plan that skips the order by rewrite.
36+
This optimization is enabled by default. Use flag `disableHybridSearchQueryPlanOptimization:true` in FeedOptions to disable this feature.
37+
38+
### Bugs Fixed
39+
#### [#34088](https://github.com/Azure/azure-sdk-for-js/pull/34088) Fix documentation for default values of `useMultipleWriteLocations` and `enableBackgroundEndpointRefreshing`.
40+
#### [#33869](https://github.com/Azure/azure-sdk-for-js/pull/33869) Fix ChangeFeed Iterator merge
41+
42+
### Other Changes
43+
#### [#34244](https://github.com/Azure/azure-sdk-for-js/pull/34244) Update murmurHash to use Uint8Array instead of Buffer.
44+
#### [#33728](https://github.com/Azure/azure-sdk-for-js/pull/33728) Update Entra authentication samples
445

546
## 4.3.0 (2025-03-18)
647

sdk/cosmosdb/cosmos/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@azure/cosmos",
3-
"version": "4.3.0",
3+
"version": "4.4.0",
44
"description": "Microsoft Azure Cosmos DB Service Node.js SDK for NOSQL API",
55
"sdk-type": "client",
66
"keywords": [

sdk/cosmosdb/cosmos/samples-dev/Query/FullTextSearch.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,20 @@ async function run(): Promise<void> {
8181
response = await container.items.query(query, { forceQueryPlan: true }).fetchAll();
8282
console.log("Response: ", response.resources);
8383

84+
// Run hybrid search queries using Weighted RRF ranking
85+
query =
86+
"SELECT TOP 3 c.text1 FROM c WHERE FullTextContains(c.text1, 'artist') ORDER BY RANK RRF (FullTextScore(c.text1, ['movies']),FullTextScore(c.text1, ['music']), [0.1, 0.2])";
87+
response = await container.items.query(query, { forceQueryPlan: true }).fetchAll();
88+
console.log("Response: ", response.resources);
89+
90+
// Run hybrid search queries using RRF ranking without query plan optimization
91+
query =
92+
"SELECT TOP 3 c.text1 FROM c WHERE FullTextContains(c.text1, 'artist') ORDER BY RANK RRF (FullTextScore(c.text1, ['movies']),FullTextScore(c.text1, ['music']))";
93+
response = await container.items
94+
.query(query, { forceQueryPlan: true, disableHybridSearchQueryPlanOptimization: true })
95+
.fetchAll();
96+
console.log("Response: ", response.resources);
97+
8498
await finish();
8599
}
86100

sdk/cosmosdb/cosmos/samples/v4/javascript/Query/FullTextSearch.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,20 @@ async function run() {
8080
response = await container.items.query(query, { forceQueryPlan: true }).fetchAll();
8181
console.log("Response: ", response.resources);
8282

83+
// Run hybrid search queries using Weighted RRF ranking
84+
query =
85+
"SELECT TOP 3 c.text1 FROM c WHERE FullTextContains(c.text1, 'artist') ORDER BY RANK RRF (FullTextScore(c.text1, ['movies']),FullTextScore(c.text1, ['music']), [0.1, 0.2])";
86+
response = await container.items.query(query, { forceQueryPlan: true }).fetchAll();
87+
console.log("Response: ", response.resources);
88+
89+
// Run hybrid search queries using RRF ranking without query plan optimization
90+
query =
91+
"SELECT TOP 3 c.text1 FROM c WHERE FullTextContains(c.text1, 'artist') ORDER BY RANK RRF (FullTextScore(c.text1, ['movies']),FullTextScore(c.text1, ['music']))";
92+
response = await container.items
93+
.query(query, { forceQueryPlan: true, disableHybridSearchQueryPlanOptimization: true })
94+
.fetchAll();
95+
console.log("Response: ", response.resources);
96+
8397
await finish();
8498
}
8599

sdk/cosmosdb/cosmos/samples/v4/typescript/src/Query/FullTextSearch.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,20 @@ async function run(): Promise<void> {
8181
response = await container.items.query(query, { forceQueryPlan: true }).fetchAll();
8282
console.log("Response: ", response.resources);
8383

84+
// Run hybrid search queries using Weighted RRF ranking
85+
query =
86+
"SELECT TOP 3 c.text1 FROM c WHERE FullTextContains(c.text1, 'artist') ORDER BY RANK RRF (FullTextScore(c.text1, ['movies']),FullTextScore(c.text1, ['music']), [0.1, 0.2])";
87+
response = await container.items.query(query, { forceQueryPlan: true }).fetchAll();
88+
console.log("Response: ", response.resources);
89+
90+
// Run hybrid search queries using RRF ranking without query plan optimization
91+
query =
92+
"SELECT TOP 3 c.text1 FROM c WHERE FullTextContains(c.text1, 'artist') ORDER BY RANK RRF (FullTextScore(c.text1, ['movies']),FullTextScore(c.text1, ['music']))";
93+
response = await container.items
94+
.query(query, { forceQueryPlan: true, disableHybridSearchQueryPlanOptimization: true })
95+
.fetchAll();
96+
console.log("Response: ", response.resources);
97+
8498
await finish();
8599
}
86100

sdk/cosmosdb/cosmos/src/common/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ export const Constants = {
218218
AzureNamespace: "Azure.Cosmos",
219219
AzurePackageName: "@azure/cosmos",
220220
SDKName: "azure-cosmos-js",
221-
SDKVersion: "4.3.0",
221+
SDKVersion: "4.4.0",
222222

223223
// Diagnostics
224224
CosmosDbDiagnosticLevelEnvVarName: "AZURE_COSMOSDB_DIAGNOSTICS_LEVEL",

0 commit comments

Comments
 (0)