Comments (4)
Hi @fadi212! Can you please elaborate on the issue? Are there any errors in client/service logs?
from qdrant-client.
@fadi212 Hi, In the Qdrant_Client class theres a upsert method to add new points. Maybe you could give it a try
Thanks
from qdrant-client.
I am trying to achieve the same, here is a quick reproducible code
# create random data
np.random.seed(0)
embeddings = np.array([np.random.rand(64) for i in range(100)])
labels = [{"label": str(i)} for i in range(100)]
- This works
client.upload_collection(
collection_name="test",
vectors=embeddings,
payload=labels,
parallel=2
)
# uploading all the embeddings at once
res = client.search(
collection_name="test",
query_vector=embeddings[0],
query_filter=None,
append_payload=True,
limit=1
)
print(res[0].payload["label"])
# output is 0, since labels are basically index of each embedding
- This doesn't works
# upload first 50 items
client.upload_collection(
collection_name="test",
vectors=embeddings[:50],
payload=labels[:50],
parallel=2
)
# upload remaining items
client.upload_collection(
collection_name="test",
vectors=embeddings[50:],
payload=labels[50:],
parallel=2
)
res = client.search(
collection_name="test",
query_vector=embeddings[0],
query_filter=None,
append_payload=True,
limit=1
)
print(res[0].payload["label"])
# output is 94, which is incorrect
I read about upsert
method but I am not able to update the collections as per the requirement I have shown in the above example. It will be very helpful If someone can share snippets to update the collection.
Update: A work around to update/add records
from qdrant_client.http.models import PointStruct
points = [PointStruct(id=i, payload=labels[i], vector=embeddings[i].tolist()) for i in range(50, 100)]
client.upsert(
collection_name="test",
points=points,
wait=True
)
from qdrant-client.
client.upload_collection(
collection_name="test",
vectors=embeddings[50:],
payload=labels[50:],
parallel=2
)
This doesn't work because ids are not specified. upload_collection
can auto-generate Ids, but it starts with 0.
from qdrant-client.
Related Issues (20)
- DatetimeRange condition checks does not support `date` in local mode HOT 1
- StartFrom does not support date HOT 1
- Failed to create collection Error: Unknown arguments: ['payload_schema']
- date conversion to grpc is broken
- Collection exists query raises a 400 error instead of returning `False` HOT 6
- replace .vector_counts in migrate with a call to count api
- Read consistency setting doesn't work with batch search HOT 1
- deprecate async grpc methods in QdrantClient
- Possible extension of count functionality HOT 8
- When using the new `.add` method, unable to provide collection config HOT 2
- remove qdrant_openapi_client HOT 1
- deprecate `rest` property in qdrant-client
- `DATETIME` is not converted from REST to gRPC HOT 3
- Wrong input: Vector params for text-sparse-new are not specified in config HOT 4
- Python got an issue using filter with not indexed payload field using client with URL and api_key. HOT 2
- update only payload of specific point HOT 2
- ValueError: Could not find config.json in .... HOT 3
- qdrant_client.http.exceptions.ResponseHandlingException: [Errno 9] Bad file descriptor HOT 1
- AsyncQdrantClient calls blocking event loop HOT 3
- `SetPayloadOperation` is slower than upserting the entire point HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qdrant-client.