Searchkick: Delete index?

Created on 13 May 2015  路  6Comments  路  Source: ankane/searchkick

Can I use searchkick to delete an index? Elastic Search recommended something like curl -XDELETE 'http://localhost:9200/twitter/' where twitter is the index name. However, which searchkick, I don't know which index names to use.

Most helpful comment

You can do Searchkick.client.indices.delete(index: name).

All 6 comments

You can do Searchkick.client.indices.delete(index: name).

It took me a moment to find the name of the index, so as a timesaver (for example model Profile):

Searchkick.client.indices.delete(index: Profile.searchkick_index.name)

Fwiw, you can now also do:

YourModel.search_index.delete

Even better 馃憤

I think that would be YourModel.searchkick_index.delete

Either will work (I personally prefer the former)

Was this page helpful?
0 / 5 - 0 ratings