lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lukas Kahwe Smith <...@pooteeweet.org>
Subject Re: dealing with dash chars in fields when using dismax
Date Sun, 13 Jun 2010 15:25:28 GMT

On 13.06.2010, at 17:20, Erick Erickson wrote:

> <<<but still is there some clean solution that doesnt mean a lot of coding
> work on my end to handle dash both as a special and as a normal char.>>>
> 
> And how would the code know? You're essentially asking for DWIM (Do What I
> Mean) functionality, which I've been awaiting for many years....
> 
> It seems a reasonable approach would be to have your power users understand
> they needed to escape hyphens. Or introduce your own syntax for negation
> which would be a simple string substitution on the way through. Or.....
> Because somewhere you need some external input that distinguishes between "I
> mean this hyphen to be a negation, but this other one to be a literal".
> 
> If this seems irrelevant, then I'm missing your point pretty badly. A use
> case or two where this distinction is important would be helpful. Or is that
> use-case <G>?


No, I was just wondering if someone by chance implemented the DWIM I want :)
But I guess for now I will just escape, since we do not advertise + and - syntax anyway atm.
Then again more and more people are learning how it works in google and are starting to just
try it out when they are doing searches.

What I might end up doing though is not escape dashes only in specific cases:
foo-bar (escape)
foo - bar (escape)
foo -bar (not escape, aka probihit bar)

This should enable power users and should rarely hit non power users.

regards,
Lukas Kahwe Smith
mls@pooteeweet.org




Mime
View raw message