I am trying to add a faceted search with thinking sphinx however I am
having issues when I am trying to add the facets to the search but I
cant seem to figure out what the issue is. The facets show up
correctly when I go about searching, but when I click on a link it
doesn't drill down the results like I want it to.
Here is the code that I am using:
In the controller:
@facets = Load.facets(
(params[:trucks]),
:page => (params[:page] || 1),
:per_page => 25,
:geo => degrees_to_radians(@location),
:with => { "@geodist" =>
0.0..miles_to_meters(params[:radius].to_i) },
:sort_mode => :expr,
:order => sort_by_select(params[:sort])
)
@results = @facets.for
In the view:
<% @facets.each do |facet, facet_options| %>
<h5><%= facet %></h5>
<ul>
<% facet_options.each do |option, count| %>
<li><%= link_to "#{option} (#{count})", :params => {facet =>
option, :page => 1} %></li>
<% end %>
</ul>
<% end %>
--
You received this message because you are subscribed to the Google Groups
"Thinking Sphinx" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/thinking-sphinx?hl=en.