Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an easy way to delete a complete Vespa document set?

Tags:

vespa

Playing with Yahoo's vespa.ai, I'm now at a point where I have a search definition with which I am happy, but still, have a bunch of garbage test documents stored.

Is there an easy way to delete/purge/drop all of them at once, ala SQL DROP TABLE or DELETE FROM X?

The only place I found at this point where deleting documents is clearly mentioned in the Document JSON format page. As far as I understand it requires deleting documents one by one, which is fine, but gets a bit cumbersome when one is just playing around.

I tried deleting the application via the Deploy API using the default tenant, but the data is still there when issuing search requests.

Did I miss something? or is this by design?

like image 323
Shastick Avatar asked Oct 18 '17 13:10

Shastick


1 Answers

There's no API available to do this, but the vespa-remove-index command line tool could help you out. Ie, to drop everything:

$ vespa-stop-services
$ vespa-remove-index
$ vespa-start-services

You could also play around with using garbage collection for this, but I wouldn't go down this path unless you are unable to use vespa-remove-index.

like image 57
Frode Lundgren Avatar answered Sep 18 '22 17:09

Frode Lundgren