Hi,
I currently have the searching working and the facets are being displayed.
If I search for something the brands facet will show up on the left telling me what brands there are and how many it has found.
However when I click on the facet on the left for a particular brand it searches everything by that brand not by the brand on the search results, how do I do this?
This is my facet code
<% @search.facet(:brand).rows.each do |row| %>
<ul>
<li>
<% if params[:brand].blank? %>
<%= link_to row.value, brand: row.value %>(<%= row.count %>)
<% else %>
<strong><%= row.value %></strong> (<%= link_to "remove", brand: nil %>)
<% end %>
</li>
</ul>
<% end %>
def load_searching
@search = Product.search do
fulltext params[:search]
facet(:brand)
with(:brand, params[:brand]) if params[:brand].present?
end
end
Product model
searchable do
text :productcode, :productname
string :brand
end
what am I missing?