Aerx.QdrantClient.Http
1.12.2
See the version list below for details.
dotnet add package Aerx.QdrantClient.Http --version 1.12.2
NuGet\Install-Package Aerx.QdrantClient.Http -Version 1.12.2
<PackageReference Include="Aerx.QdrantClient.Http" Version="1.12.2" />
<PackageVersion Include="Aerx.QdrantClient.Http" Version="1.12.2" />
<PackageReference Include="Aerx.QdrantClient.Http" />
paket add Aerx.QdrantClient.Http --version 1.12.2
#r "nuget: Aerx.QdrantClient.Http, 1.12.2"
#:package Aerx.QdrantClient.Http@1.12.2
#addin nuget:?package=Aerx.QdrantClient.Http&version=1.12.2
#tool nuget:?package=Aerx.QdrantClient.Http&version=1.12.2
.NET SDK for Qdrant vector database
.NET SDK for Qdrant vector database.
Getting started
Creating a client
A client that will connect to Qdrant HTTP API on http://localhost:6334 can be instantiated as follows
var client = new QdrantHttpClient("localhost");
Additional constructor overloads provide more control over how the client is configured. The following example configures a client to use the different Qdrant port and an api key:
var client = new QdrantHttpClient(
httpAddress: "localhost",
port: 1567,
apiKey : "my-secret-api-key"
);
Working with collections
Once a client has been created, create a new collection
var collectionCreationResult = await _qdrantHttpClient.CreateCollection(
"my_collection",
new CreateCollectionRequest(VectorDistanceMetric.Dot, vectorSize: 100, isServeVectorsFromDisk: true)
{
OnDiskPayload = true
},
cancellationToken
);
Insert vectors into a collection
var upsertPoints = Enumerable.Range(0, 100).Select(
i => new UpsertPointsRequest<TestPayload>.UpsertPoint(
PointId.Integer((ulong) i),
Enumerable.Range(0, 128)
.Select(_ => float.CreateTruncating(Random.Shared.NextDouble()))
.ToArray(),
new TestPayload()
{
Integer = 123,
Text = "test"
}
)
).ToList();
var upsertPointsResult = await _qdrantHttpClient.UpsertPoints(
"my_collection",
new UpsertPointsRequest<TestPayload>()
{
Points = upsertPoints
},
cancellationToken
);
Search for similar vectors
var queryVector = Enumerable.Range(0, 128)
.Select(_ => float.CreateTruncating(Random.Shared.NextDouble()))
.ToArray()
// return the 5 closest points
var searchResult = await _qdrantHttpClient.SearchPoints(
"my_collection",
new SearchPointsRequest(
queryVector,
limit: 5)
{
WithVector = false,
WithPayload = PayloadPropertiesSelector.All
},
cancellationToken
);
Search for similar vectors with filtering condition
var searchResult = await _qdrantHttpClient.SearchPoints(
"my_collection",
new SearchPointsRequest(
queryVector,
limit: 5)
{
WithVector = false,
WithPayload = PayloadPropertiesSelector.All,
Filter =
Q.Must(
Q.BeInRange("int_field", greaterThanOrEqual: 0)
)
+
!(
Q.MatchValue("int_field_2", 1567)
&
Q.MatchValue("text_field", "test")
)
},
cancellationToken
);
Search for similar vectors with filtering condition on typed payload
Here we are using typed builders for building filters for typed payload.
var searchResult = await _qdrantHttpClient.SearchPoints(
"my_collection",
new SearchPointsRequest(
queryVector,
limit: 5)
{
WithVector = false,
WithPayload = PayloadPropertiesSelector.All,
Filter =
Q.Must(
Q<TestPayload>.BeInRange(p => p.Integer, greaterThanOrEqual: 0)
)
|
!Q.Must(
Q<TestPayload>.MatchValue(p => p.Integer, 1)
)
},
cancellationToken
);
Building collections
Conditions are built using Q (from Qdrant or Query) and Q<TPayload> condition builders.
Top level filter should contain only Must, MustNot or Should condition groups.
Result if any call on Q or Q<TPayload> is implicitly convertible to QdrantFilter, that is accepted everywhere the filter is expected, for ease of use.
QdrantFilter can be directly directly using QdrantFilter.Create() factory method.
Non-generic condition builder Q
Non-generic condition builder methods other than Must, MustNot, Should and Nested accept string payload field name as the first parameter.
Q.Must(
Q.MatchValue("test_key", 123),
Q.MatchValue("test_key_2", "test_value")
)
Filters can be nested.
Q.Should(
Q.MustNot(Q.MatchValue("test_key", 123)),
Q.MatchValue("test_key_2", "test_value")
)
Generic condition builder Q<T>
If the type of the payload is known beforehand the generic version of condition builder Q<TPayload> can be used to avoid typos in payload field names.
Q<TPayload> has the same methods but with payload field selector expression as the first parameter.
If the payload is as defined as follows
public class TestPayload : Payload
{
public string Text { get; set; }
[JsonPropertyName("int")]
public int? IntProperty { get; set; }
public NestedClass Nested { get; set; }
public class NestedClass
{
public string Name { get; set; }
public double Double { set; get; }
public int Integer { get; set; }
}
}
Filter can access its structure to derive the payload filed names.
Property renames in payload json are supported through standard JsonPropertyNameAttribute.
Property nesting is also suppoerted in this case json dot-notation path will be constructed.
Q.Should(
Q<TestPayload>.MatchValue(p=>p.IntProperty, 123),
Q<TestPayload>.MatchValue(p=>p.Nested.Name, "test_value")
)
Filter combination operators
In addition to combining filters explicitly, the more terse combination is possible through the use of operators + , |, & and !.
+- combines top level filter conditions to simplify filter building.Q.Must( Q.BeInRange("int_field", greaterThanOrEqual: 0) ) + Q.MustNot( Q.MatchValue("int_field_2", 1567) )Which is equivalent to the following filter json
{ "must": [ { "key": "int_field", "range": { "gte": 0 } } ], "must_not": [ { "key": "int_field_2", "match": { "value": 1567 } } ] }|combines two conditions usingShouldcondiiton group. NestedShouldgroups are automatically unwrapped.Q.Must( Q.BeInRange("int_field", greaterThanOrEqual: 0) ) | Q.Should( Q.MatchValue("int_field_2", 1567) )Which is equivalent to the following filter json
{ "should": [ { "must": [ { "key": "int_field", "range": { "gte": 0 } } ] }, { "key": "int_field_2", "match": { "value": 1567 } } ] }&combines two conditions usingMustcondiiton group. NestedMustgroups are automatically unwrapped.Q.MustNot( Q.BeInRange("int_field", greaterThanOrEqual: 0) ) & Q.Must( Q.MatchValue("int_field_2", 1567) )Which is equivalent to the following filter json
{ "must": [ { "must_not": [ { "key": "int_field", "range": { "gte": 0 } } ] }, { "key": "int_field_2", "match": { "value": 1567 } } ] }!wraps condition inMustNotcondition group. Negates nestedMustandMustNotcondition groups.Q.Should( Q<TestPayload>.MatchValue(p=>p.IntProperty, 123), !Q<TestPayload>.MatchValue(p=>p.Nested.Name, "test_value") ) + !Q.Must( Q<TestPayload>.MatchValue(p=>p.IntProperty, 345) )Which is equivalent to the following filter json
{ "should": [ { "key": "int_property", "match": { "value": 123 } }, { "must_not": [ { "key": "nested.name", "match": { "value": "test_value" } } ] } ], "must_not": [ { "key": "int_property", "match": { "value": 345 } } ] }
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- CommunityToolkit.Diagnostics (>= 8.3.2)
- Microsoft.Extensions.Configuration (>= 8.0.0)
- Microsoft.Extensions.DependencyInjection (>= 8.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Http (>= 8.0.0)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 8.0.0)
- Newtonsoft.Json (>= 13.0.3)
- Polly (>= 8.4.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated | |
|---|---|---|---|
| 1.16.0-pre3 | 202 | 11/13/2025 | |
| 1.16.0-pre2 | 214 | 11/12/2025 | |
| 1.16.0-pre1 | 212 | 11/12/2025 | |
| 1.15.18 | 204 | 11/13/2025 | |
| 1.15.17 | 109 | 11/8/2025 | |
| 1.15.16 | 177 | 11/5/2025 | |
| 1.15.15 | 144 | 10/31/2025 | |
| 1.15.14 | 223 | 10/29/2025 | |
| 1.15.13 | 179 | 10/28/2025 | |
| 1.15.12 | 166 | 10/28/2025 | |
| 1.15.11 | 131 | 10/24/2025 | |
| 1.15.10 | 126 | 10/24/2025 | |
| 1.15.9 | 125 | 10/10/2025 | |
| 1.15.8 | 170 | 10/8/2025 | |
| 1.15.7 | 268 | 9/24/2025 | |
| 1.15.6 | 183 | 9/23/2025 | |
| 1.15.5 | 340 | 9/16/2025 | |
| 1.15.4 | 271 | 8/29/2025 | |
| 1.15.3 | 200 | 8/29/2025 | |
| 1.15.2 | 215 | 8/27/2025 | |
| 1.15.1 | 132 | 8/15/2025 | |
| 1.15.0 | 131 | 8/15/2025 | |
| 1.14.11 | 175 | 8/11/2025 | |
| 1.14.10 | 167 | 8/11/2025 | |
| 1.14.9 | 181 | 8/8/2025 | |
| 1.14.8 | 188 | 8/8/2025 | |
| 1.14.7 | 260 | 8/5/2025 | |
| 1.14.6 | 229 | 8/4/2025 | |
| 1.14.5 | 113 | 8/1/2025 | |
| 1.14.4 | 101 | 8/1/2025 | |
| 1.14.3 | 155 | 7/28/2025 | |
| 1.14.2 | 525 | 6/10/2025 | |
| 1.14.1 | 228 | 6/5/2025 | |
| 1.14.0 | 187 | 6/4/2025 | |
| 1.13.12 | 491 | 5/16/2025 | |
| 1.13.11 | 276 | 5/13/2025 | |
| 1.13.10 | 352 | 5/7/2025 | |
| 1.13.9 | 198 | 5/6/2025 | |
| 1.13.8 | 197 | 4/30/2025 | |
| 1.13.7 | 220 | 4/21/2025 | |
| 1.13.6 | 206 | 4/21/2025 | |
| 1.13.5 | 211 | 4/21/2025 | |
| 1.13.4 | 209 | 3/31/2025 | |
| 1.13.3 | 164 | 3/29/2025 | |
| 1.13.2 | 176 | 3/28/2025 | |
| 1.13.1 | 170 | 3/28/2025 | |
| 1.13.0 | 186 | 3/14/2025 | |
| 1.12.4 | 275 | 3/7/2025 | |
| 1.12.3 | 213 | 2/20/2025 | |
| 1.12.2 | 219 | 12/24/2024 | |
| 1.12.1 | 166 | 12/10/2024 | |
| 1.12.0 | 2,829 | 11/11/2024 | |
| 1.11.0 | 246 | 11/2/2024 | |
| 1.10.1 | 260 | 7/31/2024 | |
| 1.10.0 | 162 | 7/30/2024 | |
| 1.9.10 | 202 | 7/5/2024 | |
| 1.9.9 | 233 | 6/21/2024 | |
| 1.9.8 | 373 | 5/15/2024 | |
| 1.9.7 | 163 | 5/15/2024 | |
| 1.9.6 | 158 | 5/13/2024 | |
| 1.9.5 | 5,265 | 5/13/2024 | |
| 1.9.4 | 197 | 5/6/2024 | |
| 1.9.3 | 149 | 5/2/2024 | |
| 1.9.2 | 144 | 5/2/2024 | |
| 1.9.1 | 190 | 4/27/2024 | |
| 1.9.0 | 201 | 4/27/2024 | |
| 1.8.0 | 183 | 4/26/2024 | |
| 1.7.3 | 221 | 3/29/2024 | |
| 1.7.2 | 209 | 2/26/2024 | |
| 1.7.1 | 164 | 2/26/2024 | |
| 1.7.0 | 205 | 2/19/2024 | |
| 1.0.1 | 289 | 12/6/2023 | |
| 1.0.0 | 177 | 12/6/2023 |