mirror of
https://github.com/qdrant/landing_page.git
synced 2026-10-06 19:38:30 +02:00
Update Edge Rust snippets to the new request interfaces (#2601)
* Update Edge Rust snippets to the new request interfaces The edge crate replaced its mixed read interface with edge-owned request structs and fluent builders (qdrant/qdrant#9901). Update the Rust snippets under /documentation/edge accordingly: - retrieve() now takes a RetrieveRequest instead of a (&[ids], with_payload, with_vector) triple — this was a hard break. - Query and facet requests are built with QueryRequestBuilder / FacetRequestBuilder instead of struct literals, matching the published examples. Also note in the quickstart that parameters left unset on an EdgeConfig passed to load() now keep their persisted values, so the WAL-only config no longer resets the rest of the shard configuration. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * Bump qdrant-edge to 0.8.0 in the rust snippet template 0.8.0 is the first release carrying the edge request structs and builders the snippets in the previous commit use. Lockfile refreshed with `cargo update -p qdrant-edge --precise 0.8.0`. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
0c04d94901
commit
14fe557328
+75
-37
@@ -61,6 +61,12 @@ version = "0.2.21"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923"
|
checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "allocator-api2"
|
||||||
|
version = "0.4.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c880a97d28a3681c0267bd29cff89621202715b065127cd445fa0f0fe0aa2880"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "android_system_properties"
|
name = "android_system_properties"
|
||||||
version = "0.1.5"
|
version = "0.1.5"
|
||||||
@@ -490,6 +496,15 @@ dependencies = [
|
|||||||
"constant_time_eq",
|
"constant_time_eq",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "blink-alloc"
|
||||||
|
version = "0.4.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ce4c15bad517bc0fb4a44523adf470e2c3eb3a365769327acdba849948ea3705"
|
||||||
|
dependencies = [
|
||||||
|
"allocator-api2 0.4.0",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "block-buffer"
|
name = "block-buffer"
|
||||||
version = "0.12.0"
|
version = "0.12.0"
|
||||||
@@ -740,6 +755,17 @@ dependencies = [
|
|||||||
"memchr",
|
"memchr",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "core_affinity"
|
||||||
|
version = "0.8.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "a034b3a7b624016c6e13f5df875747cc25f884156aad2abd12b6c46797971342"
|
||||||
|
dependencies = [
|
||||||
|
"libc",
|
||||||
|
"num_cpus",
|
||||||
|
"winapi",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cpufeatures"
|
name = "cpufeatures"
|
||||||
version = "0.3.0"
|
version = "0.3.0"
|
||||||
@@ -1519,7 +1545,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1"
|
checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ahash",
|
"ahash",
|
||||||
"allocator-api2",
|
"allocator-api2 0.2.21",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -1528,7 +1554,7 @@ version = "0.15.5"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1"
|
checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"allocator-api2",
|
"allocator-api2 0.2.21",
|
||||||
"equivalent",
|
"equivalent",
|
||||||
"foldhash 0.1.5",
|
"foldhash 0.1.5",
|
||||||
]
|
]
|
||||||
@@ -1539,11 +1565,17 @@ version = "0.16.1"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100"
|
checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"allocator-api2",
|
"allocator-api2 0.2.21",
|
||||||
"equivalent",
|
"equivalent",
|
||||||
"foldhash 0.2.0",
|
"foldhash 0.2.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "hashbrown"
|
||||||
|
version = "0.17.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "heapless"
|
name = "heapless"
|
||||||
version = "0.8.0"
|
version = "0.8.0"
|
||||||
@@ -1617,6 +1649,12 @@ version = "1.0.3"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9"
|
checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "humantime"
|
||||||
|
version = "2.4.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "15cdd26707701c53297e2fa6afb323d55fbc1d0810c3aec078ae3ef0424c3c15"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hybrid-array"
|
name = "hybrid-array"
|
||||||
version = "0.4.12"
|
version = "0.4.12"
|
||||||
@@ -2000,6 +2038,15 @@ dependencies = [
|
|||||||
"either",
|
"either",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "itertools"
|
||||||
|
version = "0.15.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "8b4baf93f58d4425749ca49a51c50ebab072c5df6994d08fed93541c331481dc"
|
||||||
|
dependencies = [
|
||||||
|
"either",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "itoa"
|
name = "itoa"
|
||||||
version = "1.0.17"
|
version = "1.0.17"
|
||||||
@@ -2218,9 +2265,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "log"
|
name = "log"
|
||||||
version = "0.4.30"
|
version = "0.4.33"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "616ec5685824bcc94416c6d4a7a446eea774a31efd7062c8480ba6fd06d7a6e5"
|
checksum = "0ceec5bc11778974d1bcb055b18002eba7f4b3518b6a0081b3af5f21666da9ad"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "lru-slab"
|
name = "lru-slab"
|
||||||
@@ -2230,9 +2277,9 @@ checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "lz4_flex"
|
name = "lz4_flex"
|
||||||
version = "0.13.1"
|
version = "0.14.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7ef0d4ed8669f8f8826eb00dc878084aa8f253506c4fd5e8f58f5bce72ddb97e"
|
checksum = "ecbdfe44b1bd960b68170b417450a628c43f7cf56bb3c5317e61cb230ee7f226"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "macro_rules_attribute"
|
name = "macro_rules_attribute"
|
||||||
@@ -2806,7 +2853,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "b570b25f7617e43d59005d0990ccb79e950a423952cea19671b7a876da390adf"
|
checksum = "b570b25f7617e43d59005d0990ccb79e950a423952cea19671b7a876da390adf"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"itertools",
|
"itertools 0.14.0",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn",
|
"syn",
|
||||||
@@ -2845,9 +2892,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "qdrant-edge"
|
name = "qdrant-edge"
|
||||||
version = "0.7.2"
|
version = "0.8.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b2e5e480105a06c8f1703082758d74a13c98fb7a94df06e12d914460786e55ea"
|
checksum = "0b8072302c87506a34bffec9bc16dbdcd36df8ab1321406b6e141530348c7e54"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ahash",
|
"ahash",
|
||||||
"aligned-vec",
|
"aligned-vec",
|
||||||
@@ -2857,12 +2904,14 @@ dependencies = [
|
|||||||
"bincode 1.3.3",
|
"bincode 1.3.3",
|
||||||
"bitpacking",
|
"bitpacking",
|
||||||
"bitvec",
|
"bitvec",
|
||||||
|
"blink-alloc",
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
"byteorder",
|
"byteorder",
|
||||||
"cc",
|
"cc",
|
||||||
"cgroups-rs",
|
"cgroups-rs",
|
||||||
"charabia",
|
"charabia",
|
||||||
"chrono",
|
"chrono",
|
||||||
|
"core_affinity",
|
||||||
"crc32c",
|
"crc32c",
|
||||||
"data-encoding",
|
"data-encoding",
|
||||||
"docopt",
|
"docopt",
|
||||||
@@ -2876,10 +2925,11 @@ dependencies = [
|
|||||||
"geo",
|
"geo",
|
||||||
"geohash",
|
"geohash",
|
||||||
"half 2.7.1",
|
"half 2.7.1",
|
||||||
|
"humantime",
|
||||||
"indexmap 2.13.0",
|
"indexmap 2.13.0",
|
||||||
"integer-encoding",
|
"integer-encoding",
|
||||||
"io-uring",
|
"io-uring",
|
||||||
"itertools",
|
"itertools 0.15.0",
|
||||||
"log",
|
"log",
|
||||||
"lz4_flex",
|
"lz4_flex",
|
||||||
"macro_rules_attribute",
|
"macro_rules_attribute",
|
||||||
@@ -2891,6 +2941,7 @@ dependencies = [
|
|||||||
"num-derive",
|
"num-derive",
|
||||||
"num-traits",
|
"num-traits",
|
||||||
"num_cpus",
|
"num_cpus",
|
||||||
|
"once_cell",
|
||||||
"ordered-float 5.3.0",
|
"ordered-float 5.3.0",
|
||||||
"parking_lot",
|
"parking_lot",
|
||||||
"permutation_iterator",
|
"permutation_iterator",
|
||||||
@@ -2905,7 +2956,6 @@ dependencies = [
|
|||||||
"roaring",
|
"roaring",
|
||||||
"rustix 1.1.4",
|
"rustix 1.1.4",
|
||||||
"schemars",
|
"schemars",
|
||||||
"seahash",
|
|
||||||
"self_cell",
|
"self_cell",
|
||||||
"semver",
|
"semver",
|
||||||
"serde",
|
"serde",
|
||||||
@@ -2915,6 +2965,7 @@ dependencies = [
|
|||||||
"serde_json",
|
"serde_json",
|
||||||
"serde_variant",
|
"serde_variant",
|
||||||
"sha2",
|
"sha2",
|
||||||
|
"siphasher",
|
||||||
"slab",
|
"slab",
|
||||||
"smallvec",
|
"smallvec",
|
||||||
"strum",
|
"strum",
|
||||||
@@ -2927,7 +2978,6 @@ dependencies = [
|
|||||||
"tinyvec",
|
"tinyvec",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tonic",
|
"tonic",
|
||||||
"typed-arena",
|
|
||||||
"uuid",
|
"uuid",
|
||||||
"validator",
|
"validator",
|
||||||
"vaporetto",
|
"vaporetto",
|
||||||
@@ -2947,13 +2997,13 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "quick_cache"
|
name = "quick_cache"
|
||||||
version = "0.6.22"
|
version = "0.7.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d1c821816e9b928e20e92ed59bb3ac4aab321d16ca2316871c9fe7ca739cd477"
|
checksum = "403c1a912fec895cafb223201e368234842acb9220aaf08ab042ae89ba5f135c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ahash",
|
|
||||||
"equivalent",
|
"equivalent",
|
||||||
"hashbrown 0.16.1",
|
"foldhash 0.2.0",
|
||||||
|
"hashbrown 0.17.1",
|
||||||
"parking_lot",
|
"parking_lot",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -3526,12 +3576,6 @@ version = "1.2.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
|
checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "seahash"
|
|
||||||
version = "4.1.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "security-framework"
|
name = "security-framework"
|
||||||
version = "3.7.0"
|
version = "3.7.0"
|
||||||
@@ -3751,9 +3795,9 @@ checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "siphasher"
|
name = "siphasher"
|
||||||
version = "1.0.2"
|
version = "1.0.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b2aa850e253778c88a04c3d7323b043aeda9d3e30d5971937c1855769763678e"
|
checksum = "8ee5873ec9cce0195efcb7a4e9507a04cd49aec9c83d0389df45b1ef7ba2e649"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "slab"
|
name = "slab"
|
||||||
@@ -3892,9 +3936,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "sysinfo"
|
name = "sysinfo"
|
||||||
version = "0.38.4"
|
version = "0.39.6"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "92ab6a2f8bfe508deb3c6406578252e491d299cbbf3bc0529ecc3313aee4a52f"
|
checksum = "d2071df9448915b71c4fe6d25deaf1c22f12bd234f01540b77312bb8e41361e6"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
"memchr",
|
"memchr",
|
||||||
@@ -4265,12 +4309,6 @@ version = "0.2.5"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
|
checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "typed-arena"
|
|
||||||
version = "2.0.2"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "6af6ae20167a9ece4bcb41af5b80f8a1f1df981f6391189ce00fd257af04126a"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "typeid"
|
name = "typeid"
|
||||||
version = "1.0.3"
|
version = "1.0.3"
|
||||||
@@ -5211,18 +5249,18 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "zerocopy"
|
name = "zerocopy"
|
||||||
version = "0.8.49"
|
version = "0.8.55"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "bce33a6288fa3f072a8c2c7d0f2fdbb90e28298f0135c1f99b96c3db2efcc60b"
|
checksum = "b5a105cd7b140f6eeec8acff2ea38135d3cab283ada58540f629fe51e46696eb"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"zerocopy-derive",
|
"zerocopy-derive",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "zerocopy-derive"
|
name = "zerocopy-derive"
|
||||||
version = "0.8.49"
|
version = "0.8.55"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8fd425244944f4ab65ccff928e7323354c5a018c75838362fdce749dfad2ee1e"
|
checksum = "0fe976fb70c78cd64cccfe3a6fc142244e8a77b70959b30faf9d0ac37ee228eb"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ edition = "2024"
|
|||||||
anyhow = "1.0.100"
|
anyhow = "1.0.100"
|
||||||
chrono = "0.4"
|
chrono = "0.4"
|
||||||
csv = "1.3"
|
csv = "1.3"
|
||||||
qdrant-edge = "0.7.2"
|
qdrant-edge = "0.8.0"
|
||||||
fs-err = "3"
|
fs-err = "3"
|
||||||
ordered-float = "5"
|
ordered-float = "5"
|
||||||
qdrant-client = { git = "https://github.com/qdrant/rust-client", branch = "master" }
|
qdrant-client = { git = "https://github.com/qdrant/rust-client", branch = "master" }
|
||||||
|
|||||||
@@ -112,6 +112,8 @@ For example, to set the WAL size to 4 MB:
|
|||||||
|
|
||||||
{{< code-snippet path="/documentation/headless/snippets/edge/quickstart/" block="wal-options" >}}
|
{{< code-snippet path="/documentation/headless/snippets/edge/quickstart/" block="wal-options" >}}
|
||||||
|
|
||||||
|
When loading an existing Edge Shard, any parameter left unset on the supplied `EdgeConfig` keeps the value persisted with the shard. A config that only sets `wal_options` therefore leaves the rest of the shard's configuration untouched.
|
||||||
|
|
||||||
## More Examples
|
## More Examples
|
||||||
|
|
||||||
The Qdrant GitHub repository contains examples of using the Qdrant Edge API in [Python](https://github.com/qdrant/qdrant/tree/dev/lib/edge/python/examples) and [Rust](https://github.com/qdrant/qdrant/tree/dev/lib/edge/publish/examples).
|
The Qdrant GitHub repository contains examples of using the Qdrant Edge API in [Python](https://github.com/qdrant/qdrant/tree/dev/lib/edge/python/examples) and [Rust](https://github.com/qdrant/qdrant/tree/dev/lib/edge/publish/examples).
|
||||||
+9
-14
@@ -3,18 +3,13 @@ use qdrant_edge::*;
|
|||||||
|
|
||||||
let query_vector = bm25.embed_query("clever fox");
|
let query_vector = bm25.embed_query("clever fox");
|
||||||
|
|
||||||
let results = shard.query(QueryRequest {
|
let results = shard.query(
|
||||||
prefetches: vec![],
|
QueryRequestBuilder::new(3)
|
||||||
query: Some(ScoringQuery::Vector(QueryEnum::Nearest(NamedQuery {
|
.query(ScoringQuery::Vector(QueryEnum::Nearest(NamedQuery {
|
||||||
query: VectorInternal::from(query_vector),
|
query: VectorInternal::from(query_vector),
|
||||||
using: Some("text".to_string()),
|
using: Some("text".to_string()),
|
||||||
}))),
|
})))
|
||||||
filter: None,
|
.with_payload(WithPayloadInterface::Bool(true))
|
||||||
score_threshold: None,
|
.build(),
|
||||||
limit: 3,
|
)?;
|
||||||
offset: 0,
|
|
||||||
params: None,
|
|
||||||
with_vector: WithVector::Bool(false),
|
|
||||||
with_payload: WithPayloadInterface::Bool(true),
|
|
||||||
})?;
|
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -45,18 +45,13 @@ use qdrant_edge::*;
|
|||||||
|
|
||||||
let query_vector = bm25.embed_query("clever fox");
|
let query_vector = bm25.embed_query("clever fox");
|
||||||
|
|
||||||
let results = shard.query(QueryRequest {
|
let results = shard.query(
|
||||||
prefetches: vec![],
|
QueryRequestBuilder::new(3)
|
||||||
query: Some(ScoringQuery::Vector(QueryEnum::Nearest(NamedQuery {
|
.query(ScoringQuery::Vector(QueryEnum::Nearest(NamedQuery {
|
||||||
query: VectorInternal::from(query_vector),
|
query: VectorInternal::from(query_vector),
|
||||||
using: Some("text".to_string()),
|
using: Some("text".to_string()),
|
||||||
}))),
|
})))
|
||||||
filter: None,
|
.with_payload(WithPayloadInterface::Bool(true))
|
||||||
score_threshold: None,
|
.build(),
|
||||||
limit: 3,
|
)?;
|
||||||
offset: 0,
|
|
||||||
params: None,
|
|
||||||
with_vector: WithVector::Bool(false),
|
|
||||||
with_payload: WithPayloadInterface::Bool(true),
|
|
||||||
})?;
|
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -53,20 +53,15 @@ pub async fn main() -> anyhow::Result<()> {
|
|||||||
|
|
||||||
let query_vector = bm25.embed_query("clever fox");
|
let query_vector = bm25.embed_query("clever fox");
|
||||||
|
|
||||||
let results = shard.query(QueryRequest {
|
let results = shard.query(
|
||||||
prefetches: vec![],
|
QueryRequestBuilder::new(3)
|
||||||
query: Some(ScoringQuery::Vector(QueryEnum::Nearest(NamedQuery {
|
.query(ScoringQuery::Vector(QueryEnum::Nearest(NamedQuery {
|
||||||
query: VectorInternal::from(query_vector),
|
query: VectorInternal::from(query_vector),
|
||||||
using: Some("text".to_string()),
|
using: Some("text".to_string()),
|
||||||
}))),
|
})))
|
||||||
filter: None,
|
.with_payload(WithPayloadInterface::Bool(true))
|
||||||
score_threshold: None,
|
.build(),
|
||||||
limit: 3,
|
)?;
|
||||||
offset: 0,
|
|
||||||
params: None,
|
|
||||||
with_vector: WithVector::Bool(false),
|
|
||||||
with_payload: WithPayloadInterface::Bool(true),
|
|
||||||
})?;
|
|
||||||
// @block-end query-with-bm25
|
// @block-end query-with-bm25
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|||||||
+5
-6
@@ -1,10 +1,9 @@
|
|||||||
```rust
|
```rust
|
||||||
use qdrant_edge::*;
|
use qdrant_edge::*;
|
||||||
|
|
||||||
let facet_response = edge_shard.facet(FacetRequest {
|
let facet_response = edge_shard.facet(
|
||||||
key: "color".try_into().unwrap(),
|
FacetRequestBuilder::new("color".try_into().unwrap())
|
||||||
limit: 10,
|
.limit(10)
|
||||||
filter: None,
|
.build(),
|
||||||
exact: false,
|
)?;
|
||||||
})?;
|
|
||||||
```
|
```
|
||||||
|
|||||||
+10
-14
@@ -13,18 +13,14 @@ let filter = Filter {
|
|||||||
must_not: None,
|
must_not: None,
|
||||||
};
|
};
|
||||||
|
|
||||||
let results = edge_shard.query(QueryRequest {
|
let results = edge_shard.query(
|
||||||
prefetches: vec![],
|
QueryRequestBuilder::new(10)
|
||||||
query: Some(ScoringQuery::Vector(QueryEnum::Nearest(NamedQuery {
|
.query(ScoringQuery::Vector(QueryEnum::Nearest(NamedQuery {
|
||||||
query: vec![0.2f32, 0.1, 0.9, 0.7].into(),
|
query: vec![0.2f32, 0.1, 0.9, 0.7].into(),
|
||||||
using: Some(VECTOR_NAME.to_string()),
|
using: Some(VECTOR_NAME.to_string()),
|
||||||
}))),
|
})))
|
||||||
filter: Some(filter),
|
.filter(filter)
|
||||||
score_threshold: None,
|
.with_payload(WithPayloadInterface::Bool(true))
|
||||||
limit: 10,
|
.build(),
|
||||||
offset: 0,
|
)?;
|
||||||
params: None,
|
|
||||||
with_vector: WithVector::Bool(false),
|
|
||||||
with_payload: WithPayloadInterface::Bool(true),
|
|
||||||
})?;
|
|
||||||
```
|
```
|
||||||
|
|||||||
+9
-14
@@ -1,18 +1,13 @@
|
|||||||
```rust
|
```rust
|
||||||
use qdrant_edge::*;
|
use qdrant_edge::*;
|
||||||
|
|
||||||
let results = edge_shard.query(QueryRequest {
|
let results = edge_shard.query(
|
||||||
prefetches: vec![],
|
QueryRequestBuilder::new(10)
|
||||||
query: Some(ScoringQuery::Vector(QueryEnum::Nearest(NamedQuery {
|
.query(ScoringQuery::Vector(QueryEnum::Nearest(NamedQuery {
|
||||||
query: vec![0.2f32, 0.1, 0.9, 0.7].into(),
|
query: vec![0.2f32, 0.1, 0.9, 0.7].into(),
|
||||||
using: Some(VECTOR_NAME.to_string()),
|
using: Some(VECTOR_NAME.to_string()),
|
||||||
}))),
|
})))
|
||||||
filter: None,
|
.with_payload(WithPayloadInterface::Bool(true))
|
||||||
score_threshold: None,
|
.build(),
|
||||||
limit: 10,
|
)?;
|
||||||
offset: 0,
|
|
||||||
params: None,
|
|
||||||
with_vector: WithVector::Bool(false),
|
|
||||||
with_payload: WithPayloadInterface::Bool(true),
|
|
||||||
})?;
|
|
||||||
```
|
```
|
||||||
|
|||||||
+4
-3
@@ -2,8 +2,9 @@
|
|||||||
use qdrant_edge::*;
|
use qdrant_edge::*;
|
||||||
|
|
||||||
let retrieved = edge_shard.retrieve(
|
let retrieved = edge_shard.retrieve(
|
||||||
&[PointId::NumId(1)],
|
RetrieveRequestBuilder::new(vec![PointId::NumId(1)])
|
||||||
Some(WithPayloadInterface::Bool(true)),
|
.with_payload(WithPayloadInterface::Bool(true))
|
||||||
Some(WithVector::Bool(false)),
|
.with_vector(WithVector::Bool(false))
|
||||||
|
.build(),
|
||||||
)?;
|
)?;
|
||||||
```
|
```
|
||||||
|
|||||||
+28
-37
@@ -47,9 +47,10 @@ edge_shard.update(UpdateOperation::PointOperation(
|
|||||||
use qdrant_edge::*;
|
use qdrant_edge::*;
|
||||||
|
|
||||||
let retrieved = edge_shard.retrieve(
|
let retrieved = edge_shard.retrieve(
|
||||||
&[PointId::NumId(1)],
|
RetrieveRequestBuilder::new(vec![PointId::NumId(1)])
|
||||||
Some(WithPayloadInterface::Bool(true)),
|
.with_payload(WithPayloadInterface::Bool(true))
|
||||||
Some(WithVector::Bool(false)),
|
.with_vector(WithVector::Bool(false))
|
||||||
|
.build(),
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
use qdrant_edge::*;
|
use qdrant_edge::*;
|
||||||
@@ -66,20 +67,15 @@ edge_shard.update(UpdateOperation::VectorNameOperation(
|
|||||||
|
|
||||||
use qdrant_edge::*;
|
use qdrant_edge::*;
|
||||||
|
|
||||||
let results = edge_shard.query(QueryRequest {
|
let results = edge_shard.query(
|
||||||
prefetches: vec![],
|
QueryRequestBuilder::new(10)
|
||||||
query: Some(ScoringQuery::Vector(QueryEnum::Nearest(NamedQuery {
|
.query(ScoringQuery::Vector(QueryEnum::Nearest(NamedQuery {
|
||||||
query: vec![0.2f32, 0.1, 0.9, 0.7].into(),
|
query: vec![0.2f32, 0.1, 0.9, 0.7].into(),
|
||||||
using: Some(VECTOR_NAME.to_string()),
|
using: Some(VECTOR_NAME.to_string()),
|
||||||
}))),
|
})))
|
||||||
filter: None,
|
.with_payload(WithPayloadInterface::Bool(true))
|
||||||
score_threshold: None,
|
.build(),
|
||||||
limit: 10,
|
)?;
|
||||||
offset: 0,
|
|
||||||
params: None,
|
|
||||||
with_vector: WithVector::Bool(false),
|
|
||||||
with_payload: WithPayloadInterface::Bool(true),
|
|
||||||
})?;
|
|
||||||
|
|
||||||
use qdrant_edge::*;
|
use qdrant_edge::*;
|
||||||
|
|
||||||
@@ -95,29 +91,24 @@ let filter = Filter {
|
|||||||
must_not: None,
|
must_not: None,
|
||||||
};
|
};
|
||||||
|
|
||||||
let results = edge_shard.query(QueryRequest {
|
let results = edge_shard.query(
|
||||||
prefetches: vec![],
|
QueryRequestBuilder::new(10)
|
||||||
query: Some(ScoringQuery::Vector(QueryEnum::Nearest(NamedQuery {
|
.query(ScoringQuery::Vector(QueryEnum::Nearest(NamedQuery {
|
||||||
query: vec![0.2f32, 0.1, 0.9, 0.7].into(),
|
query: vec![0.2f32, 0.1, 0.9, 0.7].into(),
|
||||||
using: Some(VECTOR_NAME.to_string()),
|
using: Some(VECTOR_NAME.to_string()),
|
||||||
}))),
|
})))
|
||||||
filter: Some(filter),
|
.filter(filter)
|
||||||
score_threshold: None,
|
.with_payload(WithPayloadInterface::Bool(true))
|
||||||
limit: 10,
|
.build(),
|
||||||
offset: 0,
|
)?;
|
||||||
params: None,
|
|
||||||
with_vector: WithVector::Bool(false),
|
|
||||||
with_payload: WithPayloadInterface::Bool(true),
|
|
||||||
})?;
|
|
||||||
|
|
||||||
use qdrant_edge::*;
|
use qdrant_edge::*;
|
||||||
|
|
||||||
let facet_response = edge_shard.facet(FacetRequest {
|
let facet_response = edge_shard.facet(
|
||||||
key: "color".try_into().unwrap(),
|
FacetRequestBuilder::new("color".try_into().unwrap())
|
||||||
limit: 10,
|
.limit(10)
|
||||||
filter: None,
|
.build(),
|
||||||
exact: false,
|
)?;
|
||||||
})?;
|
|
||||||
|
|
||||||
edge_shard.optimize()?;
|
edge_shard.optimize()?;
|
||||||
|
|
||||||
|
|||||||
@@ -57,9 +57,10 @@ pub async fn main() -> anyhow::Result<()> {
|
|||||||
use qdrant_edge::*;
|
use qdrant_edge::*;
|
||||||
|
|
||||||
let retrieved = edge_shard.retrieve(
|
let retrieved = edge_shard.retrieve(
|
||||||
&[PointId::NumId(1)],
|
RetrieveRequestBuilder::new(vec![PointId::NumId(1)])
|
||||||
Some(WithPayloadInterface::Bool(true)),
|
.with_payload(WithPayloadInterface::Bool(true))
|
||||||
Some(WithVector::Bool(false)),
|
.with_vector(WithVector::Bool(false))
|
||||||
|
.build(),
|
||||||
)?;
|
)?;
|
||||||
// @block-end retrieve-point
|
// @block-end retrieve-point
|
||||||
|
|
||||||
@@ -80,20 +81,15 @@ pub async fn main() -> anyhow::Result<()> {
|
|||||||
// @block-start query-points
|
// @block-start query-points
|
||||||
use qdrant_edge::*;
|
use qdrant_edge::*;
|
||||||
|
|
||||||
let results = edge_shard.query(QueryRequest {
|
let results = edge_shard.query(
|
||||||
prefetches: vec![],
|
QueryRequestBuilder::new(10)
|
||||||
query: Some(ScoringQuery::Vector(QueryEnum::Nearest(NamedQuery {
|
.query(ScoringQuery::Vector(QueryEnum::Nearest(NamedQuery {
|
||||||
query: vec![0.2f32, 0.1, 0.9, 0.7].into(),
|
query: vec![0.2f32, 0.1, 0.9, 0.7].into(),
|
||||||
using: Some(VECTOR_NAME.to_string()),
|
using: Some(VECTOR_NAME.to_string()),
|
||||||
}))),
|
})))
|
||||||
filter: None,
|
.with_payload(WithPayloadInterface::Bool(true))
|
||||||
score_threshold: None,
|
.build(),
|
||||||
limit: 10,
|
)?;
|
||||||
offset: 0,
|
|
||||||
params: None,
|
|
||||||
with_vector: WithVector::Bool(false),
|
|
||||||
with_payload: WithPayloadInterface::Bool(true),
|
|
||||||
})?;
|
|
||||||
// @block-end query-points
|
// @block-end query-points
|
||||||
|
|
||||||
// @block-start filter
|
// @block-start filter
|
||||||
@@ -111,31 +107,26 @@ pub async fn main() -> anyhow::Result<()> {
|
|||||||
must_not: None,
|
must_not: None,
|
||||||
};
|
};
|
||||||
|
|
||||||
let results = edge_shard.query(QueryRequest {
|
let results = edge_shard.query(
|
||||||
prefetches: vec![],
|
QueryRequestBuilder::new(10)
|
||||||
query: Some(ScoringQuery::Vector(QueryEnum::Nearest(NamedQuery {
|
.query(ScoringQuery::Vector(QueryEnum::Nearest(NamedQuery {
|
||||||
query: vec![0.2f32, 0.1, 0.9, 0.7].into(),
|
query: vec![0.2f32, 0.1, 0.9, 0.7].into(),
|
||||||
using: Some(VECTOR_NAME.to_string()),
|
using: Some(VECTOR_NAME.to_string()),
|
||||||
}))),
|
})))
|
||||||
filter: Some(filter),
|
.filter(filter)
|
||||||
score_threshold: None,
|
.with_payload(WithPayloadInterface::Bool(true))
|
||||||
limit: 10,
|
.build(),
|
||||||
offset: 0,
|
)?;
|
||||||
params: None,
|
|
||||||
with_vector: WithVector::Bool(false),
|
|
||||||
with_payload: WithPayloadInterface::Bool(true),
|
|
||||||
})?;
|
|
||||||
// @block-end filter
|
// @block-end filter
|
||||||
|
|
||||||
// @block-start facet
|
// @block-start facet
|
||||||
use qdrant_edge::*;
|
use qdrant_edge::*;
|
||||||
|
|
||||||
let facet_response = edge_shard.facet(FacetRequest {
|
let facet_response = edge_shard.facet(
|
||||||
key: "color".try_into().unwrap(),
|
FacetRequestBuilder::new("color".try_into().unwrap())
|
||||||
limit: 10,
|
.limit(10)
|
||||||
filter: None,
|
.build(),
|
||||||
exact: false,
|
)?;
|
||||||
})?;
|
|
||||||
// @block-end facet
|
// @block-end facet
|
||||||
|
|
||||||
// @block-start optimize
|
// @block-start optimize
|
||||||
|
|||||||
+5
-12
@@ -3,20 +3,13 @@ use std::cmp::*;
|
|||||||
use std::collections::*;
|
use std::collections::*;
|
||||||
use qdrant_edge::*;
|
use qdrant_edge::*;
|
||||||
|
|
||||||
let query = QueryRequest {
|
let query = QueryRequestBuilder::new(10)
|
||||||
prefetches: vec![],
|
.query(ScoringQuery::Vector(QueryEnum::Nearest(NamedQuery {
|
||||||
query: Some(ScoringQuery::Vector(QueryEnum::Nearest(NamedQuery {
|
|
||||||
query: vec![0.2f32, 0.1, 0.9, 0.7].into(),
|
query: vec![0.2f32, 0.1, 0.9, 0.7].into(),
|
||||||
using: Some(VECTOR_NAME.to_string()),
|
using: Some(VECTOR_NAME.to_string()),
|
||||||
}))),
|
})))
|
||||||
filter: None,
|
.with_payload(WithPayloadInterface::Bool(true))
|
||||||
score_threshold: None,
|
.build();
|
||||||
limit: 10,
|
|
||||||
offset: 0,
|
|
||||||
params: None,
|
|
||||||
with_vector: WithVector::Bool(false),
|
|
||||||
with_payload: WithPayloadInterface::Bool(true),
|
|
||||||
};
|
|
||||||
|
|
||||||
let mut all_results = mutable_shard.query(query.clone())?;
|
let mut all_results = mutable_shard.query(query.clone())?;
|
||||||
all_results.extend(immutable_shard.query(query)?);
|
all_results.extend(immutable_shard.query(query)?);
|
||||||
|
|||||||
+5
-12
@@ -158,20 +158,13 @@ use std::cmp::*;
|
|||||||
use std::collections::*;
|
use std::collections::*;
|
||||||
use qdrant_edge::*;
|
use qdrant_edge::*;
|
||||||
|
|
||||||
let query = QueryRequest {
|
let query = QueryRequestBuilder::new(10)
|
||||||
prefetches: vec![],
|
.query(ScoringQuery::Vector(QueryEnum::Nearest(NamedQuery {
|
||||||
query: Some(ScoringQuery::Vector(QueryEnum::Nearest(NamedQuery {
|
|
||||||
query: vec![0.2f32, 0.1, 0.9, 0.7].into(),
|
query: vec![0.2f32, 0.1, 0.9, 0.7].into(),
|
||||||
using: Some(VECTOR_NAME.to_string()),
|
using: Some(VECTOR_NAME.to_string()),
|
||||||
}))),
|
})))
|
||||||
filter: None,
|
.with_payload(WithPayloadInterface::Bool(true))
|
||||||
score_threshold: None,
|
.build();
|
||||||
limit: 10,
|
|
||||||
offset: 0,
|
|
||||||
params: None,
|
|
||||||
with_vector: WithVector::Bool(false),
|
|
||||||
with_payload: WithPayloadInterface::Bool(true),
|
|
||||||
};
|
|
||||||
|
|
||||||
let mut all_results = mutable_shard.query(query.clone())?;
|
let mut all_results = mutable_shard.query(query.clone())?;
|
||||||
all_results.extend(immutable_shard.query(query)?);
|
all_results.extend(immutable_shard.query(query)?);
|
||||||
|
|||||||
+5
-12
@@ -176,20 +176,13 @@ pub async fn main() -> anyhow::Result<()> {
|
|||||||
use std::collections::*;
|
use std::collections::*;
|
||||||
use qdrant_edge::*;
|
use qdrant_edge::*;
|
||||||
|
|
||||||
let query = QueryRequest {
|
let query = QueryRequestBuilder::new(10)
|
||||||
prefetches: vec![],
|
.query(ScoringQuery::Vector(QueryEnum::Nearest(NamedQuery {
|
||||||
query: Some(ScoringQuery::Vector(QueryEnum::Nearest(NamedQuery {
|
|
||||||
query: vec![0.2f32, 0.1, 0.9, 0.7].into(),
|
query: vec![0.2f32, 0.1, 0.9, 0.7].into(),
|
||||||
using: Some(VECTOR_NAME.to_string()),
|
using: Some(VECTOR_NAME.to_string()),
|
||||||
}))),
|
})))
|
||||||
filter: None,
|
.with_payload(WithPayloadInterface::Bool(true))
|
||||||
score_threshold: None,
|
.build();
|
||||||
limit: 10,
|
|
||||||
offset: 0,
|
|
||||||
params: None,
|
|
||||||
with_vector: WithVector::Bool(false),
|
|
||||||
with_payload: WithPayloadInterface::Bool(true),
|
|
||||||
};
|
|
||||||
|
|
||||||
let mut all_results = mutable_shard.query(query.clone())?;
|
let mut all_results = mutable_shard.query(query.clone())?;
|
||||||
all_results.extend(immutable_shard.query(query)?);
|
all_results.extend(immutable_shard.query(query)?);
|
||||||
|
|||||||
Reference in New Issue
Block a user