qdrant-ruby 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.rspec +3 -0
- data/CHANGELOG.md +5 -0
- data/Gemfile +11 -0
- data/Gemfile.lock +82 -0
- data/LICENSE +201 -0
- data/README.md +385 -0
- data/Rakefile +8 -0
- data/lib/qdrant/aliases.rb +13 -0
- data/lib/qdrant/base.rb +11 -0
- data/lib/qdrant/client.rb +59 -0
- data/lib/qdrant/clusters.rb +30 -0
- data/lib/qdrant/collections.rb +185 -0
- data/lib/qdrant/error.rb +6 -0
- data/lib/qdrant/points.rb +285 -0
- data/lib/qdrant/service.rb +45 -0
- data/lib/qdrant/snapshots.rb +36 -0
- data/lib/qdrant/version.rb +5 -0
- data/lib/qdrant.rb +16 -0
- data/sig/qdrant.rbs +4 -0
- metadata +94 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: fd79e1fac58cbc38dfb04e780f1a4b82ceca0ec8b601090c4414fc519afb6388
|
4
|
+
data.tar.gz: 32c2e01c18699a532ca332fb69fb87881e4f627f69ad3091a5246f07bb54c268
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 9bf396fa44eaa91e55f7ab32931d94abaef25b08cad04343ea84cfef598be83efa7f24bce089adacd72862d716ad64dc0292a2afc5e53a2b0b17c604411b5879
|
7
|
+
data.tar.gz: ff78d356d410a6fbf1bc60e6373cd50c924bc0531650abe998b21ec0cb91656fc996911992ddba195aa1ef7cf913ca8e99c582b2d9a8a8f1d0e1809507e12d13
|
data/.rspec
ADDED
data/CHANGELOG.md
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,82 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
qdrant-ruby (0.9.0)
|
5
|
+
faraday (~> 2.7)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
ast (2.4.2)
|
11
|
+
byebug (11.1.3)
|
12
|
+
coderay (1.1.3)
|
13
|
+
diff-lcs (1.5.0)
|
14
|
+
faraday (2.7.4)
|
15
|
+
faraday-net_http (>= 2.0, < 3.1)
|
16
|
+
ruby2_keywords (>= 0.0.4)
|
17
|
+
faraday-net_http (3.0.2)
|
18
|
+
json (2.6.3)
|
19
|
+
language_server-protocol (3.17.0.3)
|
20
|
+
method_source (1.0.0)
|
21
|
+
parallel (1.22.1)
|
22
|
+
parser (3.2.1.1)
|
23
|
+
ast (~> 2.4.1)
|
24
|
+
pry (0.14.2)
|
25
|
+
coderay (~> 1.1)
|
26
|
+
method_source (~> 1.0)
|
27
|
+
pry-byebug (3.10.1)
|
28
|
+
byebug (~> 11.0)
|
29
|
+
pry (>= 0.13, < 0.15)
|
30
|
+
rainbow (3.1.1)
|
31
|
+
rake (13.0.6)
|
32
|
+
regexp_parser (2.7.0)
|
33
|
+
rexml (3.2.5)
|
34
|
+
rspec (3.11.0)
|
35
|
+
rspec-core (~> 3.11.0)
|
36
|
+
rspec-expectations (~> 3.11.0)
|
37
|
+
rspec-mocks (~> 3.11.0)
|
38
|
+
rspec-core (3.11.0)
|
39
|
+
rspec-support (~> 3.11.0)
|
40
|
+
rspec-expectations (3.11.0)
|
41
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
42
|
+
rspec-support (~> 3.11.0)
|
43
|
+
rspec-mocks (3.11.1)
|
44
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
45
|
+
rspec-support (~> 3.11.0)
|
46
|
+
rspec-support (3.11.0)
|
47
|
+
rubocop (1.48.1)
|
48
|
+
json (~> 2.3)
|
49
|
+
parallel (~> 1.10)
|
50
|
+
parser (>= 3.2.0.0)
|
51
|
+
rainbow (>= 2.2.2, < 4.0)
|
52
|
+
regexp_parser (>= 1.8, < 3.0)
|
53
|
+
rexml (>= 3.2.5, < 4.0)
|
54
|
+
rubocop-ast (>= 1.26.0, < 2.0)
|
55
|
+
ruby-progressbar (~> 1.7)
|
56
|
+
unicode-display_width (>= 2.4.0, < 3.0)
|
57
|
+
rubocop-ast (1.28.0)
|
58
|
+
parser (>= 3.2.1.0)
|
59
|
+
rubocop-performance (1.16.0)
|
60
|
+
rubocop (>= 1.7.0, < 2.0)
|
61
|
+
rubocop-ast (>= 0.4.0)
|
62
|
+
ruby-progressbar (1.13.0)
|
63
|
+
ruby2_keywords (0.0.5)
|
64
|
+
standard (1.25.3)
|
65
|
+
language_server-protocol (~> 3.17.0.2)
|
66
|
+
rubocop (~> 1.48.1)
|
67
|
+
rubocop-performance (~> 1.16.0)
|
68
|
+
unicode-display_width (2.4.2)
|
69
|
+
|
70
|
+
PLATFORMS
|
71
|
+
x86_64-darwin-19
|
72
|
+
x86_64-linux
|
73
|
+
|
74
|
+
DEPENDENCIES
|
75
|
+
pry-byebug (~> 3.9)
|
76
|
+
qdrant-ruby!
|
77
|
+
rake (~> 13.0)
|
78
|
+
rspec (~> 3.0)
|
79
|
+
standard (~> 1.25.0)
|
80
|
+
|
81
|
+
BUNDLED WITH
|
82
|
+
2.4.0
|
data/LICENSE
ADDED
@@ -0,0 +1,201 @@
|
|
1
|
+
Apache License
|
2
|
+
Version 2.0, January 2004
|
3
|
+
http://www.apache.org/licenses/
|
4
|
+
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
6
|
+
|
7
|
+
1. Definitions.
|
8
|
+
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
11
|
+
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
13
|
+
the copyright owner that is granting the License.
|
14
|
+
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
16
|
+
other entities that control, are controlled by, or are under common
|
17
|
+
control with that entity. For the purposes of this definition,
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
19
|
+
direction or management of such entity, whether by contract or
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
22
|
+
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
24
|
+
exercising permissions granted by this License.
|
25
|
+
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
27
|
+
including but not limited to software source code, documentation
|
28
|
+
source, and configuration files.
|
29
|
+
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
31
|
+
transformation or translation of a Source form, including but
|
32
|
+
not limited to compiled object code, generated documentation,
|
33
|
+
and conversions to other media types.
|
34
|
+
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
36
|
+
Object form, made available under the License, as indicated by a
|
37
|
+
copyright notice that is included in or attached to the work
|
38
|
+
(an example is provided in the Appendix below).
|
39
|
+
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
46
|
+
the Work and Derivative Works thereof.
|
47
|
+
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
49
|
+
the original version of the Work and any modifications or additions
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
61
|
+
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
64
|
+
subsequently incorporated within the Work.
|
65
|
+
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
72
|
+
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
78
|
+
where such license applies only to those patent claims licensable
|
79
|
+
by such Contributor that are necessarily infringed by their
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
82
|
+
institute patent litigation against any entity (including a
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
85
|
+
or contributory patent infringement, then any patent licenses
|
86
|
+
granted to You under this License for that Work shall terminate
|
87
|
+
as of the date such litigation is filed.
|
88
|
+
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
91
|
+
modifications, and in Source or Object form, provided that You
|
92
|
+
meet the following conditions:
|
93
|
+
|
94
|
+
(a) You must give any other recipients of the Work or
|
95
|
+
Derivative Works a copy of this License; and
|
96
|
+
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
98
|
+
stating that You changed the files; and
|
99
|
+
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
102
|
+
attribution notices from the Source form of the Work,
|
103
|
+
excluding those notices that do not pertain to any part of
|
104
|
+
the Derivative Works; and
|
105
|
+
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
108
|
+
include a readable copy of the attribution notices contained
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
111
|
+
of the following places: within a NOTICE text file distributed
|
112
|
+
as part of the Derivative Works; within the Source form or
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
114
|
+
within a display generated by the Derivative Works, if and
|
115
|
+
wherever such third-party notices normally appear. The contents
|
116
|
+
of the NOTICE file are for informational purposes only and
|
117
|
+
do not modify the License. You may add Your own attribution
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
120
|
+
that such additional attribution notices cannot be construed
|
121
|
+
as modifying the License.
|
122
|
+
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
124
|
+
may provide additional or different license terms and conditions
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
128
|
+
the conditions stated in this License.
|
129
|
+
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
133
|
+
this License, without any additional terms or conditions.
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
135
|
+
the terms of any separate license agreement you may have executed
|
136
|
+
with Licensor regarding such Contributions.
|
137
|
+
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
140
|
+
except as required for reasonable and customary use in describing the
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
142
|
+
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
152
|
+
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
158
|
+
incidental, or consequential damages of any character arising as a
|
159
|
+
result of this License or out of the use or inability to use the
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
162
|
+
other commercial damages or losses), even if such Contributor
|
163
|
+
has been advised of the possibility of such damages.
|
164
|
+
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
168
|
+
or other liability obligations and/or rights consistent with this
|
169
|
+
License. However, in accepting such obligations, You may act only
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
174
|
+
of your accepting any such warranty or additional liability.
|
175
|
+
|
176
|
+
END OF TERMS AND CONDITIONS
|
177
|
+
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
179
|
+
|
180
|
+
To apply the Apache License to your work, attach the following
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
182
|
+
replaced with your own identifying information. (Don't include
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
184
|
+
comment syntax for the file format. We also recommend that a
|
185
|
+
file or class name and description of purpose be included on the
|
186
|
+
same "printed page" as the copyright notice for easier
|
187
|
+
identification within third-party archives.
|
188
|
+
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
190
|
+
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
192
|
+
you may not use this file except in compliance with the License.
|
193
|
+
You may obtain a copy of the License at
|
194
|
+
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
196
|
+
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
200
|
+
See the License for the specific language governing permissions and
|
201
|
+
limitations under the License.
|
data/README.md
ADDED
@@ -0,0 +1,385 @@
|
|
1
|
+
# Qdrant
|
2
|
+
|
3
|
+
<p>
|
4
|
+
<img alt='Qdrant logo' src='https://qdrant.tech/images/logo_with_text.svg' height='50' />
|
5
|
+
+
|
6
|
+
<img alt='Ruby logo' src='https://user-images.githubusercontent.com/541665/230231593-43861278-4550-421d-a543-fd3553aac4f6.png' height='40' />
|
7
|
+
</p>
|
8
|
+
|
9
|
+
Ruby wrapper for the Qdrant vector search database API
|
10
|
+
|
11
|
+
![Tests status](https://github.com/andreibondarev/qdrant-ruby/actions/workflows/ci.yml/badge.svg)
|
12
|
+
|
13
|
+
## Installation
|
14
|
+
|
15
|
+
Install the gem and add to the application's Gemfile by executing:
|
16
|
+
|
17
|
+
$ bundle add qdrant-ruby
|
18
|
+
|
19
|
+
If bundler is not being used to manage dependencies, install the gem by executing:
|
20
|
+
|
21
|
+
$ gem install qdrant-ruby
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
### Instantiating API client
|
26
|
+
|
27
|
+
```ruby
|
28
|
+
require 'qdrant-ruby'
|
29
|
+
|
30
|
+
client = Qdrant::Client.new(
|
31
|
+
url: "your-qdrant-url",
|
32
|
+
api_key: "your-qdrant-api-key"
|
33
|
+
)
|
34
|
+
```
|
35
|
+
|
36
|
+
### Collections
|
37
|
+
|
38
|
+
```ruby
|
39
|
+
# Get list name of all existing collections
|
40
|
+
client.collections.list(collection_name: "string")
|
41
|
+
|
42
|
+
# Get detailed information about specified existing collection
|
43
|
+
client.collections.get(collection_name: "string")
|
44
|
+
|
45
|
+
# Create new collection with given parameters
|
46
|
+
client.collections.create(
|
47
|
+
collection_name: "string", # required
|
48
|
+
vectors: {}, # required
|
49
|
+
shard_number: nil,
|
50
|
+
replication_factor: nil,
|
51
|
+
write_consistency_factor: nil,
|
52
|
+
on_disk_payload: nil,
|
53
|
+
hnsw_config: nil,
|
54
|
+
wal_config: nil,
|
55
|
+
optimizers_config: nil,
|
56
|
+
init_from: nil,
|
57
|
+
quantization_config: nil
|
58
|
+
)
|
59
|
+
|
60
|
+
# Update parameters of the existing collection
|
61
|
+
client.collections.update(
|
62
|
+
collection_name: '', # required
|
63
|
+
optimizers_config: nil,
|
64
|
+
params: nil
|
65
|
+
)
|
66
|
+
|
67
|
+
# Drop collection and all associated data
|
68
|
+
client.collections.delete(collection_name: '')
|
69
|
+
|
70
|
+
# Get list of all aliases (for a collection)
|
71
|
+
client.collections.aliases(
|
72
|
+
collection_name: "string" # optional
|
73
|
+
)
|
74
|
+
|
75
|
+
# Update aliases of the collections
|
76
|
+
client.collections.update_aliases(
|
77
|
+
actions: [{
|
78
|
+
# `create_alias:`, `delete_alias` and/or `rename_alias` is required
|
79
|
+
create_alias: {
|
80
|
+
collection_name: "string", # required
|
81
|
+
alias_name: "string" # required
|
82
|
+
}
|
83
|
+
}]
|
84
|
+
)
|
85
|
+
|
86
|
+
# Create index for field in collection
|
87
|
+
client.collections.create_index(
|
88
|
+
collection_name: "string", # required
|
89
|
+
field_name: "string", # required
|
90
|
+
field_schema: "string",
|
91
|
+
wait: "boolean",
|
92
|
+
ordering: "ordering"
|
93
|
+
)
|
94
|
+
|
95
|
+
# Delete field index for collection
|
96
|
+
client.collections.delete_index(
|
97
|
+
collection_name: "string", # required
|
98
|
+
field_name: "string", # required
|
99
|
+
wait: "boolean",
|
100
|
+
ordering: "ordering"
|
101
|
+
)
|
102
|
+
|
103
|
+
# Get cluster information for a collection
|
104
|
+
client.collections.cluster_info(
|
105
|
+
collection_name: "test_collection" # required
|
106
|
+
)
|
107
|
+
|
108
|
+
# Update collection cluster setup
|
109
|
+
client.collections.update_cluster(
|
110
|
+
collection_name: "string", # required
|
111
|
+
move_shard: { # required
|
112
|
+
shard_id: "int",
|
113
|
+
to_peer_id: "int",
|
114
|
+
from_peer_id: "int"
|
115
|
+
},
|
116
|
+
timeout: "int"
|
117
|
+
)
|
118
|
+
|
119
|
+
# Create new snapshot for a collection
|
120
|
+
client.collections.create_snapshot(
|
121
|
+
collection_name: "string", # required
|
122
|
+
)
|
123
|
+
|
124
|
+
# Get list of snapshots for a collection
|
125
|
+
client.collections.list_snapshots(
|
126
|
+
collection_name: "string", # required
|
127
|
+
)
|
128
|
+
|
129
|
+
# Delete snapshot for a collection
|
130
|
+
client.collections.delete_snapshot(
|
131
|
+
collection_name: "string", # required
|
132
|
+
snapshot_name: "string" # required
|
133
|
+
)
|
134
|
+
|
135
|
+
# Recover local collection data from a snapshot. This will overwrite any data, stored on this node, for the collection. If collection does not exist - it will be created.
|
136
|
+
client.collections.restore_snapshot(
|
137
|
+
collection_name: "string", # required
|
138
|
+
filepath: "string", # required
|
139
|
+
wait: "boolean",
|
140
|
+
priority: "string"
|
141
|
+
)
|
142
|
+
|
143
|
+
# Download specified snapshot from a collection as a file
|
144
|
+
client.collections.download_snapshot(
|
145
|
+
collection_name: "string", # required
|
146
|
+
snapshot_name: "string", # required
|
147
|
+
filepath: "/dir/filename.snapshot" #require
|
148
|
+
)
|
149
|
+
```
|
150
|
+
|
151
|
+
### Points
|
152
|
+
```ruby
|
153
|
+
# Retrieve full information of single point by id
|
154
|
+
client.points.get(
|
155
|
+
collection_name: "string", # required
|
156
|
+
id: "int/string", # required
|
157
|
+
consistency: "int"
|
158
|
+
)
|
159
|
+
|
160
|
+
# Lists all data objects in reverse order of creation. The data will be returned as an array of objects.
|
161
|
+
client.points.list(
|
162
|
+
collection_name: "string", # required
|
163
|
+
ids: "[int/string]", # required
|
164
|
+
with_payload: nil,
|
165
|
+
with_vector: nil,
|
166
|
+
consistency: nil
|
167
|
+
|
168
|
+
)
|
169
|
+
|
170
|
+
# Get a single data object.
|
171
|
+
client.points.upsert(
|
172
|
+
collection_name: "string", # required
|
173
|
+
batch: {}, # required
|
174
|
+
wait: "boolean",
|
175
|
+
ordering: "string"
|
176
|
+
)
|
177
|
+
|
178
|
+
# Delete points
|
179
|
+
client.points.delete(
|
180
|
+
collection_name: "string", # required
|
181
|
+
points: "[int/string]", # either `points:` or `filter:` required
|
182
|
+
filter: {},
|
183
|
+
wait: "boolean",
|
184
|
+
ordering: "string"
|
185
|
+
)
|
186
|
+
|
187
|
+
# Set payload values for points
|
188
|
+
client.points.set_payload(
|
189
|
+
collection_name: "string", # required
|
190
|
+
payload: { # required
|
191
|
+
"property name" => "value"
|
192
|
+
},
|
193
|
+
points: "[int/string]", # `points:` or `filter:` are required
|
194
|
+
filter: {},
|
195
|
+
wait: "boolean",
|
196
|
+
ordering: "string"
|
197
|
+
)
|
198
|
+
|
199
|
+
# Replace full payload of points with new one
|
200
|
+
client.points.overwrite_payload(
|
201
|
+
collection_name: "string", # required
|
202
|
+
payload: {}, # required
|
203
|
+
wait: "boolean",
|
204
|
+
ordering: "string",
|
205
|
+
points: "[int/string]",
|
206
|
+
filter: {}
|
207
|
+
)
|
208
|
+
|
209
|
+
# Delete specified key payload for points
|
210
|
+
client.points.clear_payload_keys(
|
211
|
+
collection_name: "string", # required
|
212
|
+
keys: "[string]", # required
|
213
|
+
points: "[int/string]",
|
214
|
+
filter: {},
|
215
|
+
wait: "boolean",
|
216
|
+
ordering: "string"
|
217
|
+
)
|
218
|
+
|
219
|
+
# Delete specified key payload for points
|
220
|
+
client.points.clear_payload(
|
221
|
+
collection_name: "string", # required
|
222
|
+
points: "[int/string]", # required
|
223
|
+
wait: "boolean",
|
224
|
+
ordering: "string"
|
225
|
+
)
|
226
|
+
|
227
|
+
# Scroll request - paginate over all points which matches given filtering condition
|
228
|
+
client.points.scroll(
|
229
|
+
collection_name: "string", # required
|
230
|
+
limit: "int",
|
231
|
+
filter: {},
|
232
|
+
offset: "string",
|
233
|
+
with_payload: "boolean",
|
234
|
+
with_vector: "boolean",
|
235
|
+
consistency: "int/string"
|
236
|
+
)
|
237
|
+
|
238
|
+
# Retrieve closest points based on vector similarity and given filtering conditions
|
239
|
+
client.points.search(
|
240
|
+
collection_name: "string", # required
|
241
|
+
limit: "int", # required
|
242
|
+
vector: "[int]", # required
|
243
|
+
filter: {},
|
244
|
+
params: {},
|
245
|
+
offset: "int",
|
246
|
+
with_payload: "boolean",
|
247
|
+
with_vector: "boolean",
|
248
|
+
score_threshold: "float"
|
249
|
+
)
|
250
|
+
|
251
|
+
|
252
|
+
# Retrieve by batch the closest points based on vector similarity and given filtering conditions
|
253
|
+
client.points.batch_search(
|
254
|
+
collection_name: "string", # required
|
255
|
+
searches: [{}], # required
|
256
|
+
consistency: "int/string"
|
257
|
+
)
|
258
|
+
|
259
|
+
# Look for the points which are closer to stored positive examples and at the same time further to negative examples.
|
260
|
+
client.points.recommend(
|
261
|
+
collection_name: "string", # required
|
262
|
+
positive: "[int/string]", # required; Arrray of point IDs
|
263
|
+
limit: "int", # required
|
264
|
+
negative: "[int/string]",
|
265
|
+
filter: {},
|
266
|
+
params: {},
|
267
|
+
offset: "int",
|
268
|
+
with_payload: "boolean",
|
269
|
+
with_vector: "boolean",
|
270
|
+
score_threshold: "float"
|
271
|
+
using: "string",
|
272
|
+
lookup_from: {},
|
273
|
+
)
|
274
|
+
|
275
|
+
# Look for the points which are closer to stored positive examples and at the same time further to negative examples.
|
276
|
+
client.points.batch_recommend(
|
277
|
+
collection_name: "string", # required
|
278
|
+
searches: [{}], # required
|
279
|
+
consistency: "string"
|
280
|
+
)
|
281
|
+
|
282
|
+
# Count points which matches given filtering condition
|
283
|
+
client.points.count(
|
284
|
+
collection_name: "string", # required
|
285
|
+
filter: {},
|
286
|
+
exact: "boolean"
|
287
|
+
)
|
288
|
+
```
|
289
|
+
|
290
|
+
### Snapshots
|
291
|
+
```ruby
|
292
|
+
# Get list of snapshots of the whole storage
|
293
|
+
client.snapshots.list(
|
294
|
+
collection_name: "string" # optional
|
295
|
+
)
|
296
|
+
|
297
|
+
# Create new snapshot of the whole storage
|
298
|
+
client.snapshots.create(
|
299
|
+
collection_name: "string" # required
|
300
|
+
)
|
301
|
+
|
302
|
+
# Delete snapshot of the whole storage
|
303
|
+
client.snapshots.delete(
|
304
|
+
collection_name: "string", # required
|
305
|
+
snapshot_name: "string" # required
|
306
|
+
)
|
307
|
+
|
308
|
+
# Download specified snapshot of the whole storage as a file
|
309
|
+
client.snapshots.download(
|
310
|
+
collection_name: "string", # required
|
311
|
+
snapshot_name: "string" # required
|
312
|
+
filepath: "~/Downloads/backup.txt" # required
|
313
|
+
)
|
314
|
+
|
315
|
+
|
316
|
+
# Get the backup
|
317
|
+
client.backups.get(
|
318
|
+
backend: "filesystem",
|
319
|
+
id: "my-first-backup"
|
320
|
+
)
|
321
|
+
|
322
|
+
# Restore backup
|
323
|
+
client.backups.restore(
|
324
|
+
backend: "filesystem",
|
325
|
+
id: "my-first-backup"
|
326
|
+
)
|
327
|
+
|
328
|
+
# Check the backup restore status
|
329
|
+
client.backups.restore_status(
|
330
|
+
backend: "filesystem",
|
331
|
+
id: "my-first-backup"
|
332
|
+
)
|
333
|
+
```
|
334
|
+
|
335
|
+
### Cluster
|
336
|
+
```ruby
|
337
|
+
# Get information about the current state and composition of the cluster
|
338
|
+
client.cluster.info
|
339
|
+
|
340
|
+
# Tries to recover current peer Raft state.
|
341
|
+
client.cluster.recover
|
342
|
+
|
343
|
+
# Tries to remove peer from the cluster. Will return an error if peer has shards on it.
|
344
|
+
client.cluster.remove_peer(
|
345
|
+
peer_id: "int", # required
|
346
|
+
force: "boolean"
|
347
|
+
)
|
348
|
+
```
|
349
|
+
|
350
|
+
### Service
|
351
|
+
```ruby
|
352
|
+
# Collect telemetry data including app info, system info, collections info, cluster info, configs and statistics
|
353
|
+
client.telemetry(
|
354
|
+
anonymize: "boolean" # optional
|
355
|
+
)
|
356
|
+
|
357
|
+
# Collect metrics data including app info, collections info, cluster info and statistics
|
358
|
+
client.metrics(
|
359
|
+
anonymize: "boolean" # optional
|
360
|
+
)
|
361
|
+
|
362
|
+
# Get lock options. If write is locked, all write operations and collection creation are forbidden
|
363
|
+
client.locks
|
364
|
+
|
365
|
+
# Set lock options. If write is locked, all write operations and collection creation are forbidden. Returns previous lock options
|
366
|
+
client.set_lock(
|
367
|
+
write: "boolean" # required
|
368
|
+
error_message: "string"
|
369
|
+
)
|
370
|
+
```
|
371
|
+
|
372
|
+
## Development
|
373
|
+
|
374
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
375
|
+
|
376
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
377
|
+
|
378
|
+
## Contributing
|
379
|
+
|
380
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/andreibondarev/qdrant.
|
381
|
+
|
382
|
+
## License
|
383
|
+
|
384
|
+
qdrant-ruby is licensed under the Apache License, Version 2.0. View a copy of the License file.
|
385
|
+
|