Hi,
I'm having some difficulty querying a particular field for some
phrases connected by the OR operator.
A little bit of background: I'm indexing a field called "keywords",
which contains comma-separated keywords, some of which are phrases,
while others are single terms. I want to filter for items that contain
keyword A OR keyword B OR keyword C.
My search yields the wrong result, since phrases don't seem to get
taken into account:
Media::Set.search "Architecture", :conditions => {:keywords =>
"\"Computer Aided Design\"|Index-Browser|\"Shape Grammar\"" }
I tried every combination of enclosing the phrases in single/double
quote with/without escaping that I could think of.
I also tried to use the Sphinx extended query syntax, like for example
so:
Media::Set.search 'Architecture @keywords ("Computer Aided Design" |
Index-Browser | "Shape Grammar")', :match_mode => :extended
Again, I've experimented with tweaking the syntax in different ways.
One by one, the keywords yield the following results:
Computer Aided Design: 1 match
Index-Browser: 1 match
Shape Grammar: 3 matches
I'd expect the search for the three keywords, joined by the OR
operator to yield 5 matches, but I only ever get the one match for
"Index-Browser", which happens to be the only singe term.
What am I doing wrong? Or did I misunderstand how the OR operator is
supposed to working?
Thanks in advance for any pointers,
~ Andrea
--
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.