hmmm my guess is because source_id and level are defined via item.source(:id) and item.source.level.name.
Am I right? Any workaround ? Thanks PML On Nov 25, 12:50 am, pmlarocque <[email protected]> wrote: > hmmm trying this as suggested : > > Item.search "(@source_id #{sources}) | (@level #{level}) | > (@specialty_id #{specialty.id})", :match_mode => :extended > > note that the sources is a string like "1 | 2 | 3" > > I get the following error : > > index information_item_core: query error: field specification is only > allowed at top level > > Looking in sphinx docs... > > Thanks > > On Nov 25, 12:33 am, pmlarocque <[email protected]> wrote: > > > > > Ok thanks for your time! > > > On Nov 25, 12:30 am, Pat Allan <[email protected]> wrote: > > > > That's correct, Sphinx implicitly uses ANDs. The only way to get an OR > > > is using the manual syntax I mentioned in the previous email - I > > > realise it's not ideal, but at the moment, that's as neat as it's > > > going to get. > > > > -- > > > Pat > > > > On 25/11/2009, at 4:23 PM, pmlarocque wrote: > > > > > Thanks! > > > > > Is there a way to do something like. > > > > > Model.search "", :conditions => { :field1 => "foo", :field2 => "bar"} > > > > > And the evaluation between both condition will be a OR, maybe my test > > > > aren't ok but I feel it is a AND. > > > > > pmlarocque > > > > > On Nov 25, 12:11 am, Pat Allan <[email protected]> wrote: > > > >> I think you can manually combine conditions, perhaps something like > > > >> the following: > > > > >> Model.search "(@foo alpha) | (@bar beta)", :match_mode > > > >> => :extended > > > > >> Keep in mind that the following two lines are exactly the same: > > > >> Model.search :conditions => {:foo => "alpha"} > > > >> Model.search "@foo alpha", :match_mode => :extended > > > > >> -- > > > >> Pat > > > > >> On 25/11/2009, at 3:56 PM, pmlarocque wrote: > > > > >>> found out that it's not possible, what about a or > > > >>> between :conditions ... ? > > > > >>> Thanks > > > > >>> -- > > > > >>> 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 > > > >>> athttp://groups.google.com/group/thinking-sphinx?hl=en > > > >>> . > > > > > -- > > > > > 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 > > > > athttp://groups.google.com/group/thinking-sphinx?hl=en > > > > . -- 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.
