Sunspot Reindex And Devise

Your rails app is using Sunspot for fulltext search and Devise for authentication.

You add a field to the searchable block of a model.

How do you reindex solr as the app is protected by devise?

Start the rails console.

>ApplicationController.allow_forgery_protection = false
>app.post('/users/sign_in', {"user[email]" => "emailaddressgoeshere",'user[password]' => 'passwordgoeshere'})
>Modelname.reindex
>Sunspot.commit