Skip to content
Merged

v1.19 #164

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
124 changes: 31 additions & 93 deletions examples/node-js-basic/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,93 +93,55 @@ async function main() {
// { id: 2, payload: { city: [Array] }, vector: null }
// ]

// -------- Search ----------------
// -------- Query ----------------
const queryVector = [0.2, 0.1, 0.9, 0.7];

const res1 = await client.search(collectionName, {
vector: queryVector,
const res1 = await client.query(collectionName, {
query: queryVector,
limit: 3,
});

console.log('search result: ', res1);
console.log('query result: ', res1.points);
// prints:
// search result: [
// {
// id: 4,
// version: 3,
// score: 0.99248314,
// payload: { city: [Array] },
// vector: null
// },
// {
// id: 1,
// version: 3,
// score: 0.89463294,
// payload: {
// city: 'Berlin',
// coords: [Object],
// count: 1000000,
// country: 'Germany',
// square: 12.5
// },
// vector: null
// },
// {
// query result: [
// { id: 4, version: 7, score: 0.99248314 },
// { id: 1, version: 7, score: 0.89463294 },
// {
// id: '98a9a4b1-4ef2-46fb-8315-a97d874fe1d7',
// version: 3,
// score: 0.8543979,
// payload: { count: [Array] },
// vector: null
// }
// version: 7,
// score: 0.8543979
// }
// ]

const resBatch = await client.searchBatch(collectionName, {
const resBatch = await client.queryBatch(collectionName, {
searches: [
{
vector: queryVector,
query: queryVector,
limit: 1,
},
{
vector: queryVector,
query: queryVector,
limit: 2,
},
],
});

console.log('search batch result: ', resBatch);
const batchPoints = resBatch.map(({points}) => points);

console.log('query batch result: ', batchPoints);
// prints:
// search batch result: [
// [
// {
// id: 4,
// version: 3,
// score: 0.99248314,
// payload: null,
// vector: null
// }
// ],
// [
// {
// id: 4,
// version: 3,
// score: 0.99248314,
// payload: null,
// vector: null
// },
// {
// id: 1,
// version: 3,
// score: 0.89463294,
// payload: null,
// vector: null
// }
// ]
// query batch result: [
// [ { id: 4, version: 7, score: 0.99248314 } ],
// [
// { id: 4, version: 7, score: 0.99248314 },
// { id: 1, version: 7, score: 0.89463294 }
// ]
// ]

// -------- Search filters ----------------
// -------- Query filters ----------------

const res2 = await client.search(collectionName, {
vector: queryVector,
const res2 = await client.query(collectionName, {
query: queryVector,
limit: 3,
filter: {
must: [
Expand All @@ -193,36 +155,12 @@ async function main() {
},
});

console.log('search result with filter: ', res2);
console.log('query result with filter: ', res2.points);
// prints:
// search result with filter: [
// {
// id: 1,
// version: 3,
// score: 0.89463294,
// payload: {
// city: 'Berlin',
// coords: [Object],
// count: 1000000,
// country: 'Germany',
// square: 12.5
// },
// vector: null
// },
// {
// id: 3,
// version: 3,
// score: 0.83872515,
// payload: { city: [Array] },
// vector: null
// },
// {
// id: 2,
// version: 3,
// score: 0.66603535,
// payload: { city: [Array] },
// vector: null
// }
// query result with filter: [
// { id: 1, version: 7, score: 0.89463294 },
// { id: 3, version: 7, score: 0.83872515 },
// { id: 2, version: 7, score: 0.66603535 }
// ]

return 0;
Expand Down
2 changes: 1 addition & 1 deletion examples/node-js-basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
"author": "Qdrant Team",
"license": "Apache-2.0",
"dependencies": {
"@qdrant/qdrant-js": "^1.18.0"
"@qdrant/qdrant-js": "^1.19.0"
}
}
8 changes: 8 additions & 0 deletions packages/js-client-grpc/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @qdrant/js-client-grpc

## 1.19.0

### Minor Changes

- Qdrant v1.19.0 API
- The `Search`, `SearchBatch`, `SearchGroups`, `Recommend`, `RecommendBatch`, `RecommendGroups`, `Discover` and `DiscoverBatch` RPCs are marked deprecated upstream. Use `Query`, `QueryBatch` and `QueryGroups` instead.
- `StrictModeConfig.max_disk_usage_percent` is gone, superseded by the cluster-wide quota config, and `max_resident_memory_percent` is deprecated with removal planned for 1.21. The quota API itself is REST-only for now.

## 1.18.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/js-client-grpc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@qdrant/js-client-grpc",
"version": "1.18.0",
"version": "1.19.0",
"engines": {
"node": ">=22.0.0"
},
Expand Down
Loading