<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Edge API on Qdrant - Vector Search Engine</title><link>https://qdrant.tech/documentation/edge/edge-api/</link><description>Recent content in Edge API on Qdrant - Vector Search Engine</description><generator>Hugo</generator><language>en-us</language><managingEditor>info@qdrant.tech (Andrey Vasnetsov)</managingEditor><webMaster>info@qdrant.tech (Andrey Vasnetsov)</webMaster><atom:link href="https://qdrant.tech/documentation/edge/edge-api/index.xml" rel="self" type="application/rss+xml"/><item><title>Shard Lifecycle</title><link>https://qdrant.tech/documentation/edge/edge-api/shard-lifecycle/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><author>info@qdrant.tech (Andrey Vasnetsov)</author><guid>https://qdrant.tech/documentation/edge/edge-api/shard-lifecycle/</guid><description>&lt;h1 id="shard-lifecycle"&gt;Shard Lifecycle&lt;/h1&gt;
&lt;p&gt;An Edge Shard is backed by a directory on local disk. The lifecycle of a shard is:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Create&lt;/strong&gt; a new shard with &lt;code&gt;EdgeShard.create&lt;/code&gt; (Python) or &lt;code&gt;EdgeShard::new&lt;/code&gt; (Rust), or &lt;strong&gt;load&lt;/strong&gt; an existing one with &lt;code&gt;load&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Use&lt;/strong&gt; the shard to update and query data.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Flush&lt;/strong&gt; pending changes to disk, and &lt;strong&gt;close&lt;/strong&gt; the shard to release its resources.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Because the shard owns the files in its directory, only one &lt;code&gt;EdgeShard&lt;/code&gt; may be open on a given directory at a time.&lt;/p&gt;</description></item><item><title>Configuration</title><link>https://qdrant.tech/documentation/edge/edge-api/configuration/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><author>info@qdrant.tech (Andrey Vasnetsov)</author><guid>https://qdrant.tech/documentation/edge/edge-api/configuration/</guid><description>&lt;h1 id="configuration"&gt;Configuration&lt;/h1&gt;
&lt;p&gt;&lt;code&gt;EdgeConfig&lt;/code&gt; describes the vectors an Edge Shard stores and the parameters that govern how it indexes, stores, and searches them. Pass it to &lt;code&gt;create&lt;/code&gt;/&lt;code&gt;new&lt;/code&gt; when starting a new shard, and optionally to &lt;code&gt;load&lt;/code&gt; when reopening one.&lt;/p&gt;
&lt;p&gt;Every parameter except &lt;code&gt;vectors&lt;/code&gt; and &lt;code&gt;sparse_vectors&lt;/code&gt; is optional. A parameter left unset is considered as not specified rather than set to the default: when loading an existing shard, each unspecified parameter resolves through &lt;em&gt;provided - persisted in &lt;code&gt;edge_config.json&lt;/code&gt; - derived from the existing segments - default&lt;/em&gt;, so it keeps whatever the shard already has. This is why a configuration that sets only &lt;code&gt;wal_options&lt;/code&gt; leaves the rest of the shard&amp;rsquo;s configuration untouched.&lt;/p&gt;</description></item><item><title>Updating Data</title><link>https://qdrant.tech/documentation/edge/edge-api/updating-data/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><author>info@qdrant.tech (Andrey Vasnetsov)</author><guid>https://qdrant.tech/documentation/edge/edge-api/updating-data/</guid><description>&lt;h1 id="updating-data"&gt;Updating Data&lt;/h1&gt;
&lt;p&gt;Every write to an Edge Shard goes through a single method, &lt;code&gt;update&lt;/code&gt;, which takes one &lt;code&gt;UpdateOperation&lt;/code&gt; describing what to change. The operation is written to the write-ahead log before it is applied to storage, so an update that has returned survives a crash.&lt;/p&gt;
&lt;h2 id="update"&gt;update&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;update&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;operation&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;UpdateOperation&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="kc"&gt;None&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-rust" data-lang="rust"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;pub&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;update&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;operation&lt;/span&gt;: &lt;span class="nc"&gt;UpdateOperation&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-&amp;gt; &lt;span class="nc"&gt;OperationResult&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;Parameter&lt;/th&gt;
 &lt;th&gt;Description&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;operation&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;The operation to apply.&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;strong&gt;Returns&lt;/strong&gt; nothing in Python. In Rust, returns &lt;code&gt;Ok(())&lt;/code&gt; on success.&lt;/p&gt;</description></item><item><title>Reading Data</title><link>https://qdrant.tech/documentation/edge/edge-api/reading-data/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><author>info@qdrant.tech (Andrey Vasnetsov)</author><guid>https://qdrant.tech/documentation/edge/edge-api/reading-data/</guid><description>&lt;h1 id="reading-data"&gt;Reading Data&lt;/h1&gt;
&lt;p&gt;An Edge Shard offers several ways to read data. &lt;code&gt;query&lt;/code&gt; is the similarity search entry point, supporting prefetches, fusion, and reranking. &lt;code&gt;scroll&lt;/code&gt; pages through points without scoring them, and &lt;code&gt;retrieve&lt;/code&gt;, &lt;code&gt;count&lt;/code&gt;, and &lt;code&gt;facet&lt;/code&gt; read points and payload statistics directly.&lt;/p&gt;
&lt;aside role="status"&gt;In Rust, &lt;code&gt;query_groups&lt;/code&gt; and &lt;code&gt;search_matrix&lt;/code&gt; require the &lt;code&gt;EdgeShardRead&lt;/code&gt; trait in scope: &lt;code&gt;use qdrant_edge::EdgeShardRead;&lt;/code&gt;&lt;/aside&gt;
&lt;h2 id="query"&gt;query&lt;/h2&gt;
&lt;p&gt;Runs a query, optionally combining the results of nested prefetch queries.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;query&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;QueryRequest&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;List&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;ScoredPoint&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-rust" data-lang="rust"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;pub&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;query&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;: &lt;span class="nc"&gt;QueryRequest&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-&amp;gt; &lt;span class="nc"&gt;OperationResult&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nb"&gt;Vec&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;ScoredPoint&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Returns&lt;/strong&gt; a list of &lt;code&gt;ScoredPoint&lt;/code&gt;, ordered by score.&lt;/p&gt;</description></item><item><title>Snapshots</title><link>https://qdrant.tech/documentation/edge/edge-api/snapshots/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><author>info@qdrant.tech (Andrey Vasnetsov)</author><guid>https://qdrant.tech/documentation/edge/edge-api/snapshots/</guid><description>&lt;h1 id="snapshots"&gt;Snapshots&lt;/h1&gt;
&lt;p&gt;Snapshots move data between an Edge Shard and a Qdrant server collection. This section covers the methods; for how to combine them, refer to &lt;a href="https://qdrant.tech/documentation/edge/edge-data-synchronization-patterns/"&gt;Data Synchronization Patterns&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="unpack_snapshot"&gt;unpack_snapshot&lt;/h2&gt;
&lt;p&gt;Unpacks a snapshot archive on disk so it can be loaded as a shard. A static method in Python and an associated function in Rust, so it needs no shard instance.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nd"&gt;@staticmethod&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;unpack_snapshot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;snapshot_path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;target_path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="kc"&gt;None&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-rust" data-lang="rust"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;pub&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;unpack_snapshot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;snapshot_path&lt;/span&gt;: &lt;span class="kp"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nc"&gt;Path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;target_path&lt;/span&gt;: &lt;span class="kp"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nc"&gt;Path&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-&amp;gt; &lt;span class="nc"&gt;OperationResult&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;Parameter&lt;/th&gt;
 &lt;th&gt;Description&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;snapshot_path&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;Path to the downloaded snapshot file.&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;target_path&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;Directory to unpack into.&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;After unpacking, open the directory with &lt;code&gt;load&lt;/code&gt;. The resulting shard keeps the configuration and file layout of the collection the snapshot came from, including its vector and payload indexes.&lt;/p&gt;</description></item></channel></rss>