Hi Pat, Thanks. Yeah, I figured that out eventually. Seems like TS could be patched to join array values with a pipe to do this automatically instead of what it's currently doing. If you'd like, I'd be happy to submit a PR for it.
--Michael On Wednesday, February 25, 2015 at 3:44:14 PM UTC-8, Pat Allan wrote: > > Hi Michael > > Matching on fields in SphinxQL is done via the MATCH function (as you’ve > found) - while it may not feel so obvious via the facet approach, you’ll > probably want to try the following: > > facet_vals = “val1 | val2” > > The pipe character is the OR marker for Sphinx, so that should match > either of the values. AND is implicit, so you’d just have “val1 val2” in > that case. > > Hope this helps > > — > Pat > > On 26 Feb 2015, at 5:41 am, Michael Kintzer <[email protected] > <javascript:>> wrote: > > Hi, > > I'm running into an issue where if I perform a facet search, and the value > of the facet is an array of size > 1, the query returns no results. > Single element arrays work, so e.g. > > facet_vals = ["val1"] > results = MyObj.facets("search term", options).for(my_facet: facet_vals) > results.present? # true > > facet_vals = ["val2"] > results = MyObj.facets("search term", options).for(my_facet: facet_vals) > results.present? # true > > facet_vals = ["val1", "val2"] > results = MyObj.facets("search term", options).for(my_facet: facet_vals) > results.present? # false > > The generated query snippet looks like this: WHERE MATCH('math @my_facet > [\"val1\", \"val2\"]') > > Is multi-value MATCH not supported in TS or Sphinx itself, like WHERE > field IN (val1, val2, ...) is in SQL? > > Thanks, > > --Michael > > -- > You received this message because you are subscribed to the Google Groups > "Thinking Sphinx" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] <javascript:>. > To post to this group, send email to [email protected] > <javascript:>. > Visit this group at http://groups.google.com/group/thinking-sphinx. > For more options, visit https://groups.google.com/d/optout. > > > -- You received this message because you are subscribed to the Google Groups "Thinking Sphinx" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/thinking-sphinx. For more options, visit https://groups.google.com/d/optout.
