mirror of
https://github.com/qdrant/landing_page.git
synced 2026-10-03 01:48:32 +02:00
Give chunk 1 array document_id in ingest example
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
0ead6b8f8b
commit
bbb09d9310
+1
-1
@@ -48,7 +48,7 @@ public class Snippet
|
||||
{
|
||||
Id = 1,
|
||||
Vectors = new float[] { 0.5f, 0.6f, 0.7f, 0.8f },
|
||||
Payload = { ["document_id"] = 201 },
|
||||
Payload = { ["document_id"] = new Value[] { 200L, 201L } },
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@ await client.UpsertAsync(
|
||||
{
|
||||
Id = 1,
|
||||
Vectors = new float[] { 0.5f, 0.6f, 0.7f, 0.8f },
|
||||
Payload = { ["document_id"] = 201 },
|
||||
Payload = { ["document_id"] = new Value[] { 200L, 201L } },
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ client.Upsert(context.Background(), &qdrant.UpsertPoints{
|
||||
{
|
||||
Id: qdrant.NewIDNum(1),
|
||||
Vectors: qdrant.NewVectors(0.5, 0.6, 0.7, 0.8),
|
||||
Payload: qdrant.NewValueMap(map[string]any{"document_id": 201}),
|
||||
Payload: qdrant.NewValueMap(map[string]any{"document_id": []int{200, 201}}),
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
```java
|
||||
import static io.qdrant.client.PointIdFactory.id;
|
||||
import static io.qdrant.client.ValueFactory.list;
|
||||
import static io.qdrant.client.ValueFactory.value;
|
||||
import static io.qdrant.client.VectorsFactory.namedVectors;
|
||||
import static io.qdrant.client.VectorsFactory.vectors;
|
||||
@@ -42,6 +43,6 @@ client.upsertAsync(
|
||||
PointStruct.newBuilder()
|
||||
.setId(id(1))
|
||||
.setVectors(vectors(0.5f, 0.6f, 0.7f, 0.8f))
|
||||
.putAllPayload(Map.of("document_id", value(201)))
|
||||
.putAllPayload(Map.of("document_id", list(List.of(value(200), value(201)))))
|
||||
.build())).get();
|
||||
```
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ client.upsert(
|
||||
models.PointStruct(
|
||||
id=1,
|
||||
vector=[0.5, 0.6, 0.7, 0.8],
|
||||
payload={"document_id": 201},
|
||||
payload={"document_id": [200, 201]},
|
||||
),
|
||||
],
|
||||
)
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ client
|
||||
"chunks",
|
||||
vec![
|
||||
PointStruct::new(0, vec![0.1, 0.2, 0.3, 0.4], [("document_id", 200.into())]),
|
||||
PointStruct::new(1, vec![0.5, 0.6, 0.7, 0.8], [("document_id", 201.into())]),
|
||||
PointStruct::new(1, vec![0.5, 0.6, 0.7, 0.8], [("document_id", vec![200, 201].into())]),
|
||||
],
|
||||
))
|
||||
.await?;
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ await client.upsert("chunks", {
|
||||
{
|
||||
id: 1,
|
||||
vector: [0.5, 0.6, 0.7, 0.8],
|
||||
payload: { document_id: 201 },
|
||||
payload: { document_id: [200, 201] },
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ func Main() {
|
||||
{
|
||||
Id: qdrant.NewIDNum(1),
|
||||
Vectors: qdrant.NewVectors(0.5, 0.6, 0.7, 0.8),
|
||||
Payload: qdrant.NewValueMap(map[string]any{"document_id": 201}),
|
||||
Payload: qdrant.NewValueMap(map[string]any{"document_id": []int{200, 201}}),
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ PUT /collections/chunks/points
|
||||
{
|
||||
"id": 1,
|
||||
"vector": [0.5, 0.6, 0.7, 0.8],
|
||||
"payload": {"document_id": 201}
|
||||
"payload": {"document_id": [200, 201]}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
+2
-1
@@ -1,6 +1,7 @@
|
||||
package com.example.snippets_amalgamation;
|
||||
|
||||
import static io.qdrant.client.PointIdFactory.id;
|
||||
import static io.qdrant.client.ValueFactory.list;
|
||||
import static io.qdrant.client.ValueFactory.value;
|
||||
import static io.qdrant.client.VectorsFactory.namedVectors;
|
||||
import static io.qdrant.client.VectorsFactory.vectors;
|
||||
@@ -45,7 +46,7 @@ public class Snippet {
|
||||
PointStruct.newBuilder()
|
||||
.setId(id(1))
|
||||
.setVectors(vectors(0.5f, 0.6f, 0.7f, 0.8f))
|
||||
.putAllPayload(Map.of("document_id", value(201)))
|
||||
.putAllPayload(Map.of("document_id", list(List.of(value(200), value(201)))))
|
||||
.build())).get();
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ client.upsert(
|
||||
models.PointStruct(
|
||||
id=1,
|
||||
vector=[0.5, 0.6, 0.7, 0.8],
|
||||
payload={"document_id": 201},
|
||||
payload={"document_id": [200, 201]},
|
||||
),
|
||||
],
|
||||
)
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@ pub async fn main() -> anyhow::Result<()> {
|
||||
"chunks",
|
||||
vec![
|
||||
PointStruct::new(0, vec![0.1, 0.2, 0.3, 0.4], [("document_id", 200.into())]),
|
||||
PointStruct::new(1, vec![0.5, 0.6, 0.7, 0.8], [("document_id", 201.into())]),
|
||||
PointStruct::new(1, vec![0.5, 0.6, 0.7, 0.8], [("document_id", vec![200, 201].into())]),
|
||||
],
|
||||
))
|
||||
.await?;
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ await client.upsert("chunks", {
|
||||
{
|
||||
id: 1,
|
||||
vector: [0.5, 0.6, 0.7, 0.8],
|
||||
payload: { document_id: 201 },
|
||||
payload: { document_id: [200, 201] },
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user