Hello,

I'm having a problem searching for attributes with a value equal to 0.

Here is what happen in irb:

  >> Course.search(:with=> {:days=>["2"]})
  returns the corresponding records

  >> Course.search(:with=> {:days=>["0"]})
  returns all the records, while I'm expecting only a few records to
be returned.

Here are the pieces of code I think are involved:

 course.rb
    has_many :events, :through => :tracks
    ...
    define_index do
      has events(:day_of_week), :as => :days,  :type => :integer
    end
    ...
    def self.advanced_search(search, sort = nil)
      with_params = {}
      ...
      if (!search.days.empty?)
        with_params[:days] = search.days
      end
      ...
      search(
        search.keywords,
        :with => with_params,
        :sort_mode => sort_params[:sort_mode],
        :order => sort_params[:order]).collect
    end
  end


Can anybody help me understand why I don't get the expected result?

Thanks!
Alex

-- 
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.

Reply via email to