10

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?

Madhukar
  • 1,194
  • 1
  • 13
  • 29
Shastick
  • 1,218
  • 1
  • 12
  • 29

1 Answers1

9

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.

Shastick
  • 1,218
  • 1
  • 12
  • 29
Frode Lundgren
  • 336
  • 1
  • 4
  • 2
    note: this needs to be run on all content nodes. if you are having your data distributed on multiple content nodes. – enator Oct 26 '17 at 12:56