Edge v0.6 docs (#2199)

* Initial Rust snippets

* Update content for Rust

* Upgrade Rust to 1.94.0; test Edge code snippets against dev

* Temporarily test against Edge shim crate

* Move to EdgeShardConfig and EdgeVectorParams

* Add docs for payload indexing, filtering, facet(), and optimize()

* De-emphasize on-device use case

* Update link to Rust examples on Github

* Flattened API

* Switch to new/create and load to initialize shards

* Fixups for released packages

* Mention recover_partial_snapshot on method list

* Link to Github dev branch for examples

---------

Co-authored-by: xzfc <xzfcpw@gmail.com>
This commit is contained in:
Abdon Pijpelink
2026-03-23 15:10:51 +01:00
committed by GitHub
co-authored by xzfc
parent 2a0ed4346f
commit ea0de4c12e
67 changed files with 5607 additions and 382 deletions
@@ -7,11 +7,7 @@ weight: 10
## Install Qdrant Edge
First, install the [Python Bindings for Qdrant Edge](https://pypi.org/project/qdrant-edge-py/):
```python
pip install qdrant-edge-py
```
First, install the [Python Bindings for Qdrant Edge](https://pypi.org/project/qdrant-edge-py/) or the [Rust crate](https://crates.io/crates/qdrant-edge).
## Create a Storage Directory
@@ -21,16 +17,20 @@ A Qdrant Edge Shard stores its data in a local directory on disk. Create the dir
## Configure the Edge Shard
An Edge Shard is configured with a definition of the dense and sparse vectors that can be stored in the Edge Shard, similar to how you would configure a Qdrant collection. Set up a configuration by creating an instance of `EdgeConfig`:
An Edge Shard is configured with a definition of the dense and sparse vectors that can be stored in the Edge Shard, similar to how you would configure a Qdrant collection.
Set up a configuration by creating an instance of `EdgeConfig`. For example:
{{< code-snippet path="/documentation/headless/snippets/edge/quickstart/" block="configure-edge-shard" >}}
## Initialize the Edge Shard
Now you can create an instance of `EdgeShard` with the storage directory and the configuration:
Now you can create a new `EdgeShard` using `EdgeShard.create` (Python) or `EdgeShard::new` (Rust), passing the storage directory and configuration:
{{< code-snippet path="/documentation/headless/snippets/edge/quickstart/" block="initialize-edge-shard" >}}
Note that `create` and `new` will fail if the storage directory already contains data. To initialize an Edge Shard with existing data, see [Load Existing Edge Shard from Disk](#load-existing-edge-shard-from-disk).
## Work with Points
An Edge Shard has several methods to work with points. To add points, use the `update` method:
@@ -41,12 +41,40 @@ To retrieve a point by ID, use the `retrieve` method:
{{< code-snippet path="/documentation/headless/snippets/edge/quickstart/" block="retrieve-point" >}}
## Create a Payload Index
To optimize operations like [filtering](#filtering) and [faceting](#faceting) on payload fields, first create a payload index on the fields you plan to use with these operations:
{{< code-snippet path="/documentation/headless/snippets/edge/quickstart/" block="create-payload-index" >}}
## Query Points
To query points in the Edge Shard, use the `query` method:
{{< code-snippet path="/documentation/headless/snippets/edge/quickstart/" block="query-points" >}}
## Filter points
You can also filter points based on payload fields:
{{< code-snippet path="/documentation/headless/snippets/edge/quickstart/" block="filter" >}}
## Create Facets
To create facets on a payload field, use the `facet` method.
{{< code-snippet path="/documentation/headless/snippets/edge/quickstart/" block="facet" >}}
## Optimize the Edge Shard
Optimization is the process of removing data marked for deletion, merging segments, and creating indexes. Qdrant Edge does not have a background optimizer. Instead, an application can call the `optimize` method to synchronously run optimization at a suitable time, such as during low-traffic periods or after a batch of updates.
{{< code-snippet path="/documentation/headless/snippets/edge/quickstart/" block="optimize" >}}
The optimizer can be configured using the `optimizers` parameter of `EdgeConfig` when initializing the Edge Shard. For example:
{{< code-snippet path="/documentation/headless/snippets/edge/quickstart/" block="configure-optimizer" >}}
## Close the Edge Shard
When shutting down your application, close the Edge Shard to ensure all data is flushed to disk. The data is persisted on disk and can be used to reopen the Edge Shard.
@@ -55,11 +83,10 @@ When shutting down your application, close the Edge Shard to ensure all data is
## Load Existing Edge Shard from Disk
After closing an Edge Shard, you can reopen it by loading its data and configuration from disk. Create a new `EdgeShard` instance with the storage directory:
After closing an Edge Shard, you can reopen it by loading its data and configuration from disk using the `load` method:
{{< code-snippet path="/documentation/headless/snippets/edge/quickstart/" block="load-edge-shard" >}}
## More Examples
More examples and advanced usage of Qdrant Edge API can be found in the [GitHub repository](https://github.com/qdrant/qdrant/tree/master/lib/edge/python/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).