Thanks Pat-

This is pretty good.  I thought it likely I would need to crack into
some type of regex for this.  This doesn't quite get me there since it
does this:

Cassini-Huygens -> Cassini Huygens

This can deliver some false positives since it will match with
[Cassini Foo Huygens], [Huygens Cassini], etc.

I'll keep on this.  Not being very wise in the ways of regex I worry
that I will end up writing some parser, but that is not the end of the
world.

Matt

On Jan 14, 7:20 pm, Pat Allan <[email protected]> wrote:
> Hi Matt
>
> You can escape characters for Sphinx queries, so I think the best approach is 
> to contruct your own escape method, which could so something like the 
> following:
>
>   query.gsub(/(\w)-(\w)/) { "#{$1}\\-#{$2}" }
>
> This will keep -'s with spaces on either side, assuming they mean NOT.
>
> --
> Pat
>
> On 15/01/2010, at 6:27 AM, mpokress wrote:
>
>
>
> > Hi-
>
> > I would like to know if there is a config.yml setting that will allow
> > me to implicitly perform this mapping:
>
> > Cassini-Huygens -> "Cassini-Huygens"
>
> > Sphinx defaults to treating the hyphen as a NOT.  I don't think this
> > is intuitive behavior for our application.  A Google like
> > implementation implicitly maps like this:
>
> > Cassini-Huygens -> "Cassini-Huygens"
> > Cassini -Huygens -> Cassini NOT Huygens
>
> > If there is not a setting for this, is it possible to provide an
> > operator map override so that "-" and "+" are always treated like
> > characters and not logical operators.  I am comfortable educating
> > users to always use & and !
>
> > Thanks,
>
> > Matt
> > --
> > 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.


Reply via email to