I''ve been having problems submitting a question to this forum so sorry in advance if this is a repeat. I am not looking for code examples, just a pointer in the right direction as far as design. I am trying to do a search based on information form 4 select boxes. None of the select boxes are mandatory so there could be a lot of possible combinations. search for field one, field one and two, field two and three, etc. I know an if else statement for all the possible combinations would not be the right way to go. Should I use Ferret or Sphinx to do a search like this or is there a better way. Thanks in advance. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Google for "searchlogic". It''s a rails plugin that makes stuff like this very easy to do. Jamey On Wed, Mar 31, 2010 at 2:42 PM, Chris Hickman <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> I''ve been having problems submitting a question to this forum so sorry > in advance if this is a repeat. > > I am not looking for code examples, just a pointer in the right > direction as far as design. I am trying to do a search based on > information form 4 select boxes. None of the select boxes are mandatory > so there could be a lot of possible combinations. > > search for field one, field one and two, field two and three, etc. > > I know an if else statement for all the possible combinations would not > be the right way to go. Should I use Ferret or Sphinx to do a search > like this or is there a better way. > > Thanks in advance. > -- > Posted via http://www.ruby-forum.com/. > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
I researched searchlogic prior to posting and unless I am missing something I don''t see how it would get around something like this: if a,b & c but not d ... elsif a & b but not c & d .... elsif a and not b,c & d I did see something construct a mysql query, based on something like: query = "" if a then query << "" if b then query << "" if c then query << "" if d then query << "" but they also stated this was a bad idea... Am I missing something within the searchlogic doc? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.