Hi Peter
What's your define_index block looking like? You'll probably need an
attribute for book_type_id, and then use :with (although :conditions
will work too, but I recommend keeping filters (for attributes
-- :with) and query arguments (for fields -- :conditions) separate.
Cheers
--
Pat
On 20/04/2009, at 7:39 PM, peter_tellgren wrote:
>
> Dear all
> I am struggling a bit here with my advance search form where I want my
> users to be able to find books.
> I have in my search a select with 3 options, All, Paperback and
> Hardcover.
>
> What I got in my db is a column with book_type_id 1 = paperback, 2 =
> Hardcover.
>
> The problem I am having is that my all option is returning no results
> since there are no records with the id = 0.
>
> How do I solve this i my case?
>
> I have tried:
> Book.search params[:q], :conditions => { :type => params[:t] }
> Book.search params[:q], :with => { :type => params[:t] }
>
> with both I get no result when params[:t] is not passed (i.e. all
> types interestin).
>
> grateful for any help.
> >
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---