mercredi 9 novembre 2016

Seamlessly create index with Searckick

For test purposes, I want to do something like this:

product = Product.create name: 'coffee'
product.reindex

This will fail, though, if the product index doesn't yet exist. What's the simplest way to create the index if it doesn't exist, or just use it if it does exist (and not reset it)?

Aucun commentaire:

Enregistrer un commentaire