Note that there are some explanatory texts on larger screens.

plurals
  1. PORESTful implementation of sitewide (multiple models) search with Sunspot Solr Search through a SearchController. Is that correct?
    text
    copied!<p>So I am using a SearchController to manage sitewide searches (user queries are full-text searched in two different models), and it works in the rails development server, but it doesn't work on Heroku. I suspect this means I am committing some sort of MVC or RESTful logic error because I think I have had this issue before with heroku and my localhost server where the latter was more lenient with my code. Should I be using a collection or member route of some sort?</p> <p><strong>Search Controller:</strong></p> <pre><code> def index @search = Post.search do fulltext params[:search] end @posts = @search.results @search = Group.search do fulltext params[:search] end @groups = @search.results end </code></pre> <p><strong>Route:</strong></p> <pre><code>resources :search, :only =&gt; [:index] </code></pre> <p><strong>Search form (in HAML):</strong></p> <pre><code>-form_tag '/search', :method =&gt; :get do =text_field_tag :search, params[:search], :id =&gt; 'searchfield' =submit_tag 'search',:name =&gt; nil, :id =&gt; 'searchbutton' </code></pre> <p><strong>Heroku Logs from the failed action:</strong></p> <pre><code>2011-12-16T04:05:20+00:00 app[web.1]: Started GET "/search?utf8=%E2%9C%93&amp;search=integer" for 68.6.74.167 at 2011-12-15 20:05:20 -0800 2011-12-16T04:05:20+00:00 app[web.1]: Processing by SearchController#index as HTML 2011-12-16T04:05:20+00:00 app[web.1]: Parameters: {"utf8"=&gt;"✓", "search"=&gt;"integer"} 2011-12-16T04:05:23+00:00 heroku[router]: GET stormy-robot-3215.heroku.com/search dyno=web.1 queue=0 wait=0ms service=3030ms status=500 bytes=728 2011-12-16T04:05:23+00:00 app[web.1]: Completed in 3022ms 2011-12-16T04:05:23+00:00 app[web.1]: 2011-12-16T04:05:23+00:00 app[web.1]: Errno::ECONNREFUSED (Connection refused - connect(2)): 2011-12-16T04:05:23+00:00 app[web.1]: app/controllers/search_controller.rb:3:in `index' 2011-12-16T04:05:23+00:00 app[web.1]: 2011-12-16T04:05:23+00:00 app[web.1]: </code></pre> <p>Thanks for your help. Let me know if I should give any more information</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload