elasticsearch-rails
elasticsearch-rails copied to clipboard
Fixes `Indexer` README to work with ES 7+
Old Indexer example doesn't work on ES 7. Main problem is specifying
type inside Client.index.
This PR changes the example to work.
Connected to #967
💚 CLA has been signed
Hi @dixpac, Thank you for this contribution! Can you sign the Contributor Agreement please?
We may instead want to just stop using type at all in the example in the README since it's been deprecated. I'll take a look to update any more places where we're referring to type when using 7.x versions of the stack.
@picandocodigo no problem, signed!
Hi @dixpac Maybe also we need to call IndexerWorker after commit changes to database Cause in postgres with json field I had an issue with that
after_commit { ElasticSearch::IndexerWorker.perform_async((persisted? ? :index : :delete), self.class.to_s, self.id) }