Search code examples
ruby-on-railsrubyherokuelasticsearchbonsai-elasticsearch

Force flag on Bonsai elasticsearch import not working (heroku)


I'm following "Ruby on Rails" to set-up my Bonsai Elastic Search Heroku add-on, but the FORCE flag is not working.

Here's the command from the instructions:

heroku run rake environment elasticsearch:import:model CLASS='Company' FORCE=yes

And here's the error message:

ArgumentError: companies does not exist to be imported into. Use create_index! or the :force option to create it.

What am I doing wrong? Should I use :force instead of FORCE?


Solution

  • The solution was to use curl to create the index. Something about heroku, possibly, doesn't allow the standard command to work.

    For users, you would do something like this: (replacing the username, password, and url....)

    curl -XPUT http://username:[email protected]/users