Hello,
I'm having a simple (I think) problem: I want to perform a search with
(or conditions) but using a NOT clause.
For example, I'd like to search for 'pancakes' in any category but not
inside the category 5 (just an id, for example).
I've been trying to something like this:
MyModel.search 'pancakes', :with => { :category_id => 'NOT 5' } #
or :conditions
But it doesn't work... (without the NOT there it will correctly search
only inside the given category). I did some tests with ! or - too but,
without any success.
Thinking a bit more... I found a solution using the extended2
match_mode and a query like this: "pancakes @category_id !5". It works
but I think it's a little ugly. :)
Well, my question here is simple: is there any way to perform a NOT
operation with conditions or with hashes?
Thanks for this incredible project!
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---