docarray / docarray

Represent, send, store and search multimodal data
https://docs.docarray.org/
Apache License 2.0
2.94k stars 231 forks source link

Delete an Index of Weaviate with docarray API #1735

Open isspek opened 1 year ago

isspek commented 1 year ago

Initial Checks

Description

Hi everyone,

I started using docarray with Weaviate. My question is about clearing index of Weaviate by using the docarray API. I have set up a collection as shown at the below code. It is a test collection, and want to clear or remove this index after testing. How can I clear/remove it with the docarray library? Thanks a lot!

runtimeconfig = WeaviateDocumentIndex.RuntimeConfig(batch_config=batch_config)
store = WeaviateDocumentIndex[MyIndex](
   host="http://localhost:8080", index_name="MyIndex"
)
store.configure(runtimeconfig) 

Affected Components

JoanFM commented 1 year ago

For the moment you can check the execute_query method where u can pass ur custom Weaviate query to delete ur index (check Weaviate docs for that). On the othrr hand we can try to add a more native API for this method, something like delete or clear

hsm207 commented 1 year ago

@isspek do you mean you want to delete a class in weaviate but using the docarray api?

isspek commented 1 year ago

Hi @hsm207, yes correct. I'd like to do that with the docarray api.

hsm207 commented 1 year ago

@isspek noted. That is not possible at the moment. Right now, only delete by document ids is supported e.g:

del test_index[["1", "2"]]
JoanFM commented 1 year ago

u could use the execute_query method

samedovzaur commented 1 year ago

Initial Checks

  • [x] I have searched Google & GitHub for similar requests and couldn't find anything
  • [x] I have read and followed the docs and still think this feature is missing

Description

Hi everyone,

I started using docarray with Weaviate. My question is about clearing index of Weaviate by using the docarray API. I have set up a collection as shown at the below code. It is a test collection, and want to clear or remove this index after testing. How can I clear/remove it with the docarray library? Thanks a lot!

runtimeconfig = WeaviateDocumentIndex.RuntimeConfig(batch_config=batch_config)
store = WeaviateDocumentIndex[MyIndex](
   host="http://localhost:8080", index_name="MyIndex"
)
store.configure(runtimeconfig) 

Affected Components

Instead of deleting that can we update it into an empty string? Just asking :)