qdrant-ruby 0.10.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0207e687f622cdcf258c493bb8b75c783c9847574abe41fcf4489f93ba40752c
4
- data.tar.gz: 48df2d6de390314ff6d6b18f2d155d118c81c417d8f21c2032ce2681094945b8
3
+ metadata.gz: 6899d046fe093cba0a8f390313bba21f2febb5319984fa516b99d2d3a825af17
4
+ data.tar.gz: e99fb180f6d3adca5f91133d5b88869a11fb5b004147c3ddb0987428b479713d
5
5
  SHA512:
6
- metadata.gz: 65b92ac01bc6346e03f1a4ce928292a5ce4ed0eff4fc36083199b2d6db3b096a9b9a9ca2e07de0d2936490e83b338c3ce0d2d70bafd60a8617aa20aa438c43c5
7
- data.tar.gz: f301dd5bc6d3014af75ee6ae9916937b2324ab7abd444199b3c7ba843c8192ad1c610fb827183894e597c61552e81695d1b78f8674353c541521485213296439
6
+ metadata.gz: 619eb3d6fa73efb8bc57351418c6db3824f9b2fa416911be4555278944489d29cebf9892f26c23ff7406b631450a992059e8c84f05f64845a3d45799f9844fe5
7
+ data.tar.gz: c336aa478ac184ce7c70543bd5faaa15ce3d3340a77862ef3d0ccbbcfbe80430348ca0977f83591ace3309d18d108140e3e7e304e3d037c81711fec1939a35f9
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.11.0] - 2026-10-21
4
+ - Fix `collections.restore_snapshot` to use PUT (POST always returned 404)
5
+ - Fix `clusters.remove_peer` to call `DELETE /cluster/peer/{peer_id}` instead of `POST /cluster/recover`
6
+ - `client.aliases` no longer caches the first response
7
+ - `points.list` now requires `ids:` (the API always required it)
8
+ - Deprecation warnings for `points.search`, `batch_search`, `recommend`, `batch_recommend` (use `points.query`), the lock API and `init_from:` (both removed in Qdrant 1.16)
9
+ - README: fix inaccurate examples and remove the nonexistent `backups` section
10
+
3
11
  ## [0.10.0] - 2026-08-12
4
12
  - Drop Faraday dependency
5
13
 
data/Gemfile CHANGED
@@ -8,4 +8,4 @@ gemspec
8
8
  gem "rake", "~> 13.4"
9
9
 
10
10
  gem "rspec", "~> 3.13"
11
- gem "standard", "~> 1.56.0"
11
+ gem "standard", "~> 1.57.0"
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- qdrant-ruby (0.10.0)
4
+ qdrant-ruby (0.11.0)
5
5
  logger
6
6
 
7
7
  GEM
@@ -13,12 +13,12 @@ GEM
13
13
  coderay (1.1.3)
14
14
  diff-lcs (1.6.2)
15
15
  io-console (0.9.2)
16
- json (2.21.2)
16
+ json (3.1.0)
17
17
  language_server-protocol (3.17.0.6)
18
18
  lint_roller (1.1.0)
19
19
  logger (1.7.0)
20
20
  method_source (1.1.0)
21
- parallel (2.1.0)
21
+ parallel (2.3.0)
22
22
  parser (3.3.12.0)
23
23
  ast (~> 2.4.1)
24
24
  racc
@@ -33,7 +33,7 @@ GEM
33
33
  racc (1.8.1)
34
34
  rainbow (3.1.1)
35
35
  rake (13.4.2)
36
- regexp_parser (2.12.0)
36
+ regexp_parser (2.13.1)
37
37
  reline (0.7.0)
38
38
  io-console (~> 0.5)
39
39
  rspec (3.13.2)
@@ -49,8 +49,8 @@ GEM
49
49
  diff-lcs (>= 1.2.0, < 2.0)
50
50
  rspec-support (~> 3.13.0)
51
51
  rspec-support (3.13.7)
52
- rubocop (1.88.2)
53
- json (~> 2.3)
52
+ rubocop (1.91.0)
53
+ json (>= 2.3)
54
54
  language_server-protocol (~> 3.17.0.2)
55
55
  lint_roller (~> 1.1.0)
56
56
  parallel (>= 1.10)
@@ -68,10 +68,10 @@ GEM
68
68
  rubocop (>= 1.75.0, < 2.0)
69
69
  rubocop-ast (>= 1.47.1, < 2.0)
70
70
  ruby-progressbar (1.13.0)
71
- standard (1.56.0)
71
+ standard (1.57.0)
72
72
  language_server-protocol (~> 3.17.0.2)
73
73
  lint_roller (~> 1.0)
74
- rubocop (~> 1.88.0)
74
+ rubocop (~> 1.91.0)
75
75
  standard-custom (~> 1.0.0)
76
76
  standard-performance (~> 1.8)
77
77
  standard-custom (1.0.2)
@@ -80,9 +80,9 @@ GEM
80
80
  standard-performance (1.9.0)
81
81
  lint_roller (~> 1.1)
82
82
  rubocop-performance (~> 1.26.0)
83
- unicode-display_width (3.2.0)
84
- unicode-emoji (~> 4.1)
85
- unicode-emoji (4.2.0)
83
+ unicode-display_width (3.3.0)
84
+ unicode-emoji (~> 4.3)
85
+ unicode-emoji (4.3.0)
86
86
 
87
87
  PLATFORMS
88
88
  arm64-darwin-23
@@ -96,7 +96,7 @@ DEPENDENCIES
96
96
  qdrant-ruby!
97
97
  rake (~> 13.4)
98
98
  rspec (~> 3.13)
99
- standard (~> 1.56.0)
99
+ standard (~> 1.57.0)
100
100
 
101
101
  BUNDLED WITH
102
102
  2.5.3
data/README.md CHANGED
@@ -52,6 +52,7 @@ client.collections.get(collection_name: "string")
52
52
  client.collections.create(
53
53
  collection_name: "string", # required
54
54
  vectors: {}, # required
55
+ sparse_vectors: nil,
55
56
  shard_number: nil,
56
57
  replication_factor: nil,
57
58
  write_consistency_factor: nil,
@@ -59,7 +60,6 @@ client.collections.create(
59
60
  hnsw_config: nil,
60
61
  wal_config: nil,
61
62
  optimizers_config: nil,
62
- init_from: nil,
63
63
  quantization_config: nil
64
64
  )
65
65
 
@@ -73,11 +73,14 @@ client.collections.update(
73
73
  # Drop collection and all associated data
74
74
  client.collections.delete(collection_name: "string")
75
75
 
76
- # Get list of all aliases (for a collection)
76
+ # Get list of all aliases for a collection
77
77
  client.collections.aliases(
78
- collection_name: "string" # optional
78
+ collection_name: "string" # required
79
79
  )
80
80
 
81
+ # Get list of all aliases across all collections
82
+ client.aliases
83
+
81
84
  # Update aliases of the collections
82
85
  client.collections.update_aliases(
83
86
  actions: [{
@@ -101,9 +104,7 @@ client.collections.create_index(
101
104
  # Delete field index for collection
102
105
  client.collections.delete_index(
103
106
  collection_name: "string", # required
104
- field_name: "string", # required
105
- wait: "boolean",
106
- ordering: "ordering"
107
+ field_name: "string" # required
107
108
  )
108
109
 
109
110
  # Get cluster information for a collection
@@ -118,8 +119,7 @@ client.collections.update_cluster(
118
119
  shard_id: "int",
119
120
  to_peer_id: "int",
120
121
  from_peer_id: "int"
121
- },
122
- timeout: "int"
122
+ }
123
123
  )
124
124
 
125
125
  # Create new snapshot for a collection
@@ -167,28 +167,57 @@ client.points.get(
167
167
  client.points.get_all(
168
168
  collection_name: "string", # required
169
169
  ids: "[int]", # required
170
- with_payload: "boolean"
171
- with_vector: "boolean"
170
+ with_payload: "boolean",
171
+ with_vector: "boolean",
172
+ consistency: "int/string"
172
173
  )
173
174
 
174
- # Lists all data objects in reverse order of creation. The data will be returned as an array of objects.
175
+ # Retrieve full information of points by ids. Same as `get_all`.
175
176
  client.points.list(
176
177
  collection_name: "string", # required
177
178
  ids: "[int/string]", # required
178
179
  with_payload: nil,
179
180
  with_vector: nil,
180
181
  consistency: nil
181
-
182
182
  )
183
183
 
184
- # Get a single data object.
184
+ # Insert or update points. Either `points:` or `batch:` is required.
185
185
  client.points.upsert(
186
186
  collection_name: "string", # required
187
- batch: {}, # required
187
+ points: [], # record-oriented: array of point hashes
188
+ batch: {}, # column-oriented: hash of parallel arrays
188
189
  wait: "boolean",
189
190
  ordering: "string"
190
191
  )
191
192
 
193
+ # Record-oriented upsert: each point is a hash with its own id, vector and payload
194
+ client.points.upsert(
195
+ collection_name: "my_collection",
196
+ points: [
197
+ {id: 1, vector: [0.9, 0.1, 0.1], payload: {color: "red"}},
198
+ {id: 2, vector: [0.1, 0.9, 0.1], payload: {color: "green"}},
199
+ {id: 3, vector: [0.1, 0.1, 0.9], payload: {color: "blue"}}
200
+ ]
201
+ )
202
+
203
+ # Column-oriented (batch) upsert: ids, vectors and payloads are passed as parallel arrays
204
+ client.points.upsert(
205
+ collection_name: "my_collection",
206
+ batch: {
207
+ ids: [1, 2, 3],
208
+ vectors: [
209
+ [0.9, 0.1, 0.1],
210
+ [0.1, 0.9, 0.1],
211
+ [0.1, 0.1, 0.9]
212
+ ],
213
+ payloads: [
214
+ {color: "red"},
215
+ {color: "green"},
216
+ {color: "blue"}
217
+ ]
218
+ }
219
+ )
220
+
192
221
  # Delete points
193
222
  client.points.delete(
194
223
  collection_name: "string", # required
@@ -249,6 +278,28 @@ client.points.scroll(
249
278
  consistency: "int/string"
250
279
  )
251
280
 
281
+ # Universally query points: covers search, recommend and discover, plus hybrid and multi-stage queries
282
+ client.points.query(
283
+ collection_name: "string", # required
284
+ query: "[float]/{}", # a vector, a point ID, or a query object such as {recommend: {positive: [1]}}
285
+ using: "string",
286
+ prefetch: {},
287
+ filter: {},
288
+ params: {},
289
+ score_threshold: "float",
290
+ limit: "int",
291
+ offset: "int",
292
+ with_payload: "boolean",
293
+ with_vector: "boolean",
294
+ lookup_from: {},
295
+ shard_key: "string",
296
+ consistency: "int/string",
297
+ timeout: "int"
298
+ )
299
+
300
+ # DEPRECATED (since Qdrant 1.13): `search`, `batch_search`, `recommend` and `batch_recommend`
301
+ # still work but are no longer documented by Qdrant and will be removed. Use `points.query` instead.
302
+
252
303
  # Retrieve closest points based on vector similarity and given filtering conditions
253
304
  client.points.search(
254
305
  collection_name: "string", # required
@@ -281,9 +332,9 @@ client.points.recommend(
281
332
  offset: "int",
282
333
  with_payload: "boolean",
283
334
  with_vector: "boolean",
284
- score_threshold: "float"
335
+ score_threshold: "float",
285
336
  using: "string",
286
- lookup_from: {},
337
+ lookup_from: {}
287
338
  )
288
339
 
289
340
  # Look for the points which are closer to stored positive examples and at the same time further to negative examples.
@@ -304,58 +355,33 @@ client.points.count(
304
355
  ### Snapshots
305
356
  ```ruby
306
357
  # Get list of snapshots of the whole storage
307
- client.snapshots.list(
308
- collection_name: "string" # optional
309
- )
358
+ client.snapshots.list
310
359
 
311
360
  # Create new snapshot of the whole storage
312
- client.snapshots.create(
313
- collection_name: "string" # required
314
- )
361
+ client.snapshots.create
315
362
 
316
363
  # Delete snapshot of the whole storage
317
364
  client.snapshots.delete(
318
- collection_name: "string", # required
319
- snapshot_name: "string" # required
365
+ snapshot_name: "string" # required
320
366
  )
321
367
 
322
368
  # Download specified snapshot of the whole storage as a file
323
369
  client.snapshots.download(
324
- collection_name: "string", # required
325
- snapshot_name: "string" # required
326
- filepath: "~/Downloads/backup.txt" # required
327
- )
328
-
329
-
330
- # Get the backup
331
- client.backups.get(
332
- backend: "filesystem",
333
- id: "my-first-backup"
334
- )
335
-
336
- # Restore backup
337
- client.backups.restore(
338
- backend: "filesystem",
339
- id: "my-first-backup"
340
- )
341
-
342
- # Check the backup restore status
343
- client.backups.restore_status(
344
- backend: "filesystem",
345
- id: "my-first-backup"
370
+ snapshot_name: "string", # required
371
+ filepath: "~/Downloads/backup.snapshot" # required
346
372
  )
347
373
  ```
348
374
 
349
375
  ### Cluster
350
376
  ```ruby
351
377
  # Get information about the current state and composition of the cluster
352
- client.cluster.info
378
+ client.clusters.info
353
379
 
354
380
  # Tries to recover current peer Raft state.
355
- client.cluster.recover
381
+ client.clusters.recover
356
382
 
357
383
  # Tries to remove peer from the cluster. Will return an error if peer has shards on it.
358
- client.cluster.remove_peer(
384
+ client.clusters.remove_peer(
359
385
  peer_id: "int", # required
360
386
  force: "boolean"
361
387
  )
@@ -373,12 +399,14 @@ client.metrics(
373
399
  anonymize: "boolean" # optional
374
400
  )
375
401
 
402
+ # DEPRECATED: the lock API was removed in Qdrant 1.16. These only work against older servers.
403
+
376
404
  # Get lock options. If write is locked, all write operations and collection creation are forbidden
377
405
  client.locks
378
406
 
379
407
  # Set lock options. If write is locked, all write operations and collection creation are forbidden. Returns previous lock options
380
408
  client.set_lock(
381
- write: "boolean" # required
409
+ write: "boolean", # required
382
410
  error_message: "string"
383
411
  )
384
412
  ```
data/lib/qdrant/base.rb CHANGED
@@ -7,5 +7,13 @@ module Qdrant
7
7
  def initialize(client:)
8
8
  @client = client
9
9
  end
10
+
11
+ private
12
+
13
+ # Point the warning at the caller's code, skipping frames inside the gem and Forwardable.
14
+ def deprecation_warning(message)
15
+ uplevel = caller_locations.index { |loc| !loc.path.start_with?(__dir__) && !loc.path.end_with?("/forwardable.rb") }
16
+ warn("[DEPRECATION] Qdrant: #{message}", uplevel: uplevel + 1)
17
+ end
10
18
  end
11
19
  end
data/lib/qdrant/client.rb CHANGED
@@ -37,7 +37,7 @@ module Qdrant
37
37
  end
38
38
 
39
39
  def aliases
40
- @aliases ||= Qdrant::Aliases.new(client: self).list
40
+ Qdrant::Aliases.new(client: self).list
41
41
  end
42
42
 
43
43
  def collections
@@ -21,7 +21,7 @@ module Qdrant
21
21
  peer_id:,
22
22
  force: nil
23
23
  )
24
- response = client.connection.post("#{PATH}/recover") do |req|
24
+ response = client.connection.delete("#{PATH}/peer/#{peer_id}") do |req|
25
25
  req.params["force"] = force if force
26
26
  end
27
27
  response.body
@@ -31,6 +31,8 @@ module Qdrant
31
31
  init_from: nil,
32
32
  quantization_config: nil
33
33
  )
34
+ deprecation_warning("`init_from:` was removed in Qdrant 1.16 and is ignored by the server.") unless init_from.nil?
35
+
34
36
  response = client.connection.put("#{PATH}/#{collection_name}") do |req|
35
37
  req.body = {}
36
38
  req.body["vectors"] = vectors
@@ -176,7 +178,7 @@ module Qdrant
176
178
  priority: nil,
177
179
  wait: nil
178
180
  )
179
- response = client.connection.post("#{PATH}/#{collection_name}/snapshots/recover") do |req|
181
+ response = client.connection.put("#{PATH}/#{collection_name}/snapshots/recover") do |req|
180
182
  req.params["wait"] = wait unless wait.nil?
181
183
 
182
184
  req.body = {
data/lib/qdrant/points.rb CHANGED
@@ -4,10 +4,10 @@ module Qdrant
4
4
  class Points < Base
5
5
  PATH = "points"
6
6
 
7
- # Lists all data objects in reverse order of creation. The data will be returned as an array of objects.
7
+ # Retrieve full information of points by ids. Same as `get_all`.
8
8
  def list(
9
9
  collection_name:,
10
- ids: nil,
10
+ ids:,
11
11
  with_payload: nil,
12
12
  with_vector: nil,
13
13
  consistency: nil
@@ -212,6 +212,8 @@ module Qdrant
212
212
  score_threshold: nil,
213
213
  consistency: nil
214
214
  )
215
+ deprecation_warning("`points.search` is deprecated since Qdrant 1.13 and will be removed from the server; use `points.query` instead.")
216
+
215
217
  response = client.connection.post("collections/#{collection_name}/#{PATH}/search") do |req|
216
218
  req.params["consistency"] = consistency unless consistency.nil?
217
219
 
@@ -234,6 +236,8 @@ module Qdrant
234
236
  searches:,
235
237
  consistency: nil
236
238
  )
239
+ deprecation_warning("`points.batch_search` is deprecated since Qdrant 1.13 and will be removed from the server; use `points.query` instead.")
240
+
237
241
  response = client.connection.post("collections/#{collection_name}/#{PATH}/search/batch") do |req|
238
242
  req.params["consistency"] = consistency unless consistency.nil?
239
243
 
@@ -259,6 +263,8 @@ module Qdrant
259
263
  lookup_from: nil,
260
264
  consistency: nil
261
265
  )
266
+ deprecation_warning("`points.recommend` is deprecated since Qdrant 1.13 and will be removed from the server; use `points.query` instead.")
267
+
262
268
  response = client.connection.post("collections/#{collection_name}/#{PATH}/recommend") do |req|
263
269
  req.params["consistency"] = consistency unless consistency.nil?
264
270
 
@@ -284,6 +290,8 @@ module Qdrant
284
290
  searches:,
285
291
  consistency: nil
286
292
  )
293
+ deprecation_warning("`points.batch_recommend` is deprecated since Qdrant 1.13 and will be removed from the server; use `points.query` instead.")
294
+
287
295
  response = client.connection.post("collections/#{collection_name}/#{PATH}/recommend/batch") do |req|
288
296
  req.params["consistency"] = consistency unless consistency.nil?
289
297
 
@@ -27,6 +27,8 @@ module Qdrant
27
27
  write:,
28
28
  error_message: nil
29
29
  )
30
+ deprecation_warning("the lock API was removed in Qdrant 1.16; `set_lock` only works against older servers.")
31
+
30
32
  response = client.connection.post("locks") do |req|
31
33
  req.body = {
32
34
  write: write
@@ -38,6 +40,8 @@ module Qdrant
38
40
 
39
41
  # Get lock options. If write is locked, all write operations and collection creation are forbidden
40
42
  def locks
43
+ deprecation_warning("the lock API was removed in Qdrant 1.16; `locks` only works against older servers.")
44
+
41
45
  response = client.connection.get("locks")
42
46
  response.body
43
47
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Qdrant
4
- VERSION = "0.10.0"
4
+ VERSION = "0.11.0"
5
5
  end
data/script/e2e.rb CHANGED
@@ -85,22 +85,22 @@ begin
85
85
  puts "e2e: point write and read round trip passed"
86
86
 
87
87
  body = ok_body!(
88
- client.points.search(
88
+ client.points.query(
89
89
  collection_name: collection_name,
90
- vector: [1.0, 0.0, 0.0],
90
+ query: [1.0, 0.0, 0.0],
91
91
  limit: 1,
92
92
  with_payload: true,
93
93
  with_vector: false
94
94
  ),
95
- "points.search"
95
+ "points.query"
96
96
  )
97
- hit = body.fetch("result").first
98
- assert!(hit && hit["id"] == 1, "points.search did not return point 1 first")
99
- assert!(hit["score"].to_f > 0.99, "points.search score was #{hit["score"].inspect}")
97
+ hit = body.dig("result", "points").first
98
+ assert!(hit && hit["id"] == 1, "points.query did not return point 1 first")
99
+ assert!(hit["score"].to_f > 0.99, "points.query score was #{hit["score"].inspect}")
100
100
 
101
101
  body = ok_body!(client.points.count(collection_name: collection_name, exact: true), "points.count")
102
102
  assert!(body.dig("result", "count") == 2, "points.count did not return 2")
103
- puts "e2e: search and count passed"
103
+ puts "e2e: query and count passed"
104
104
 
105
105
  body = ok_body!(client.points.delete(collection_name: collection_name, points: [1, 2], wait: true), "points.delete")
106
106
  assert!(body.dig("result", "status") == "completed", "points.delete did not return a completed status")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qdrant-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrei Bondarev