Model.search_for_ids :conditions => {:name => '@
(name,note_description) *blah*'},
:match_mode => :extended2,
:per_page => 100, :max_matches => 100,
:with => {:note_person_id => 1234, :note_created_at =>
1.week.ago..Time.now},
:group_by => 'id',
:group_function => :attr,
:group_clause => '@relevance desc'
The AND logic between filters works unless i try to filter by date
range on an association.
In the case above the results will all contain 'blah' in them, will
all have 'note' with person_id = 1234 AND will have a 'note' with
create_at inside a range, bot NOT necessarily with id 1234.
Speaking sql language:
I expect the simple
... LEFT JOIN notes WHERE notes.person_id = 1234 AND notes.created_at
> week_ago AND notes.created_at < now
I get
... LEFT JOIN notes a LEFT JOIN notes b WHERE a.person_id = 1234 AND
b.created_at > week_ago AND b.created_at < now
I very much hope you get the idea. This is the best example i can
think of.