-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4605af9
commit b3694b7
Showing
12 changed files
with
1,062 additions
and
1,042 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
using Qdrant.Client; | ||
using Qdrant.Client.Grpc; | ||
using static Qdrant.Client.Grpc.Conditions; | ||
|
||
var client = new QdrantClient("localhost", 6334); | ||
|
||
await client.SearchAsync( | ||
collectionName: "{collection_name}", | ||
vector: new float[] { 0.2f, 0.1f, 0.9f, 0.7f }, | ||
filter: MatchKeyword("city", "London"), | ||
limit: 3 | ||
); | ||
collectionName: "{collection_name}", | ||
vector: new float[] { 0.2f, 0.1f, 0.9f, 0.7f }, | ||
filter: MatchKeyword("city", "London"), | ||
searchParams: new SearchParams { Exact = false, HnswEf = 128 }, | ||
limit: 3 | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,23 @@ | ||
import java.util.List; | ||
|
||
import static io.qdrant.client.ConditionFactory.matchKeyword; | ||
|
||
import io.qdrant.client.QdrantClient; | ||
import io.qdrant.client.QdrantGrpcClient; | ||
|
||
import io.qdrant.client.grpc.Points.Filter; | ||
import io.qdrant.client.grpc.Points.SearchParams; | ||
import io.qdrant.client.grpc.Points.SearchPoints; | ||
|
||
QdrantClient client = new QdrantClient( | ||
QdrantGrpcClient.newBuilder("localhost", 6334, false).build()); | ||
QdrantClient client = | ||
new QdrantClient(QdrantGrpcClient.newBuilder("localhost", 6334, false).build()); | ||
|
||
client | ||
.searchAsync( | ||
SearchPoints.newBuilder() | ||
.setCollectionName("{collection_name}") | ||
.setFilter(Filter.newBuilder().addMust(matchKeyword("city", "London")).build()) | ||
.setParams(SearchParams.newBuilder().setExact(false).setHnswEf(128).build()) | ||
.addAllVector(List.of(0.2f, 0.1f, 0.9f, 0.7f)) | ||
.setLimit(3) | ||
.build()) | ||
.get(); | ||
.get(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,34 @@ | ||
import static io.qdrant.client.PointIdFactory.id; | ||
import static io.qdrant.client.VectorFactory.vector; | ||
import static io.qdrant.client.VectorsFactory.namedVectors; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
import static io.qdrant.client.PointIdFactory.id; | ||
import static io.qdrant.client.ValueFactory.value; | ||
import static io.qdrant.client.VectorsFactory.vectors; | ||
|
||
import io.qdrant.client.QdrantClient; | ||
import io.qdrant.client.QdrantGrpcClient; | ||
|
||
import io.qdrant.client.grpc.Points.PointStruct; | ||
|
||
QdrantClient client = new QdrantClient( | ||
QdrantGrpcClient.newBuilder("localhost", 6334, false).build()); | ||
QdrantClient client = | ||
new QdrantClient(QdrantGrpcClient.newBuilder("localhost", 6334, false).build()); | ||
|
||
client | ||
.upsertAsync( | ||
"{collection_name}", | ||
List.of( | ||
PointStruct.newBuilder() | ||
.setId(id(1)) | ||
.setVectors( | ||
namedVectors( | ||
Map.of( | ||
"image", | ||
vector(List.of(0.9f, 0.1f, 0.1f, 0.2f)), | ||
"text", | ||
vector(List.of(0.4f, 0.7f, 0.1f, 0.8f, 0.1f, 0.1f, 0.9f, 0.2f))))) | ||
.setVectors(vectors(0.9f, 0.1f, 0.1f)) | ||
.putAllPayload(Map.of("color", value("red"))) | ||
.build(), | ||
PointStruct.newBuilder() | ||
.setId(id(2)) | ||
.setVectors( | ||
namedVectors( | ||
Map.of( | ||
"image", | ||
List.of(0.2f, 0.1f, 0.3f, 0.9f), | ||
"text", | ||
List.of(0.5f, 0.2f, 0.7f, 0.4f, 0.7f, 0.2f, 0.3f, 0.9f)))) | ||
.setVectors(vectors(0.1f, 0.9f, 0.1f)) | ||
.putAllPayload(Map.of("color", value("green"))) | ||
.build(), | ||
PointStruct.newBuilder() | ||
.setId(id(3)) | ||
.setVectors(vectors(0.1f, 0.1f, 0.9f)) | ||
.putAllPayload(Map.of("color", value("blue"))) | ||
.build())) | ||
.get(); | ||
.get(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters