Hi Martin I don't think Sphinx really has the flexibility you're after, unfortunately - at least, not for those kinds of queries. It's not feasible via queries or filters (filters match what's there, or explicitly what's not - but you don't really want to say "Make sure *all* tags but 1 and 2 aren't in the set" because I think there are hard limits about how many values filters can be applied with (so if you have a few hundred thousand tags, that's not really going to work).
Personally, I'd be looking to do that query using SQL, and optimise it with indexes as much as possible. It's not going to be a fun query though. Sorry I can't be more help. -- Pat On 16/01/2009, at 6:15 AM, Martin Emde wrote: > Hi all, > > I have an object that only has tags. Each object has a unique set of > tags but tags are used multiple times. > > Here's an example > > A has tags [1, 2, 3] > > B has tags [1, 2] > > C has tags [2, 3] > > D has tags [1, 3] > > If I search for 1,2 or 1,3 or 2,3 how do I avoid getting A and > instead only get B, C or D? > > Closest I've found so far is "1 2"~1 which will match only if > those tags are all right next to eachother with no words in between. > Only problem is that "1 2"~1 will match "1 2 3" if I'm not mistaken. > > If there was a way to say "matches those tags and tag count is > exactly 2" then that would do it but I cant figure out a way to > index a count like that. > > Any suggestions? > > Martin > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
