title: Thinking Sphinx Faceted Search Implementation Examples?
body: <p>I am putting together a repository-type rails 3 site.
  I have Thinking Sphinx installed and working on my site, insomuch as I can enter urls like <code>localhost:3000/articles?search=test&amp;page=2</code> and it will return the expected results.</p>
  
  <p>I'm new to Rails (and web dev in general); I think I can manage the model and controller aspects of this, but the views so far have me stumped. I have a sidebar I would like to use as the search interface.  The closest I have come is this (rendered as part of a sidebar partial):</p>
  
  <pre><code>&lt;% form_tag @search, :method =&gt; :get do %&gt; 
      &lt;%= text_field_tag :search, params[:search] %&gt; 
      &lt;%= submit_tag "Search"%&gt; 
  &lt;% end %&gt;
  </code></pre>
  
  <p>The search method is in my articles#index controller, and when I test it when the browser is pointed to that page (routed as <code>/articles</code>), it works as expected, but with this odd url: <code>localhost:3000/articles?utf8=✓&amp;search=test&amp;commit=Search</code>. When the browser is first pointed to the root path, nothing happens.</p>
  
  <p>So, I think these are the main issues I need to address:</p>
  
  <ol>
  <li>EDIT - solved (see below)</li>
  <li>Should I move the search methods to their own controller, or should they be part of the articles controller? For now, Article will be the only model indexed.</li>
  <li>EDIT - solved (see below)</li>
  <li>Does anyone have any good example code of a faceted search view using Rails 3 and Thinking Sphinx? Like I said, I am something of a neophyte and am a little flustered by the documentation that skims by the view implementation. However, I am fairly adept at reading and interpreting code as long as it is reasonably complete.</li>
  </ol>
  
  <p>Thanks in advance!</p>
  
  <p>Solved:</p>
  
  <ol>
  <li><p>How do I make the 'Search' button call the index method before trying to search? (I have solved this by replacing <code>@search</code> with <code>articles_path</code>).</p></li>
  <li><p>Solved using <code>will_paginate</code>, which I had trouble with before, but which seems to be working now.</p></li>
  </ol>