Matthias Nöbel
2012-Jun-07 15:34 UTC
[Xapian-discuss] Wildcardsearch with words with a hyphen
Hello, i have a problem with the wildcardsearch (Flag 'FLAG_WILDCARD' activated) and words with a hyphen. Here is a small test script: http://psserver.fdog.de/test_mn/xap_test.php If the wilcard is set before the hyphen, everthing is fine. Is the wildcard placed after the hyphen (test-w*) the wildcard has no effect. I know the used Xapian version is outdated, but i haven't found any bugreports about the combination wildcards and hyphens. So i guess an update won't solve the problem, right? Is there anything i can do? Escaping, setting additional Flags, ...? Maybe someone had the problem as well and knows workarround? Thanks a lot. Regards Matthias
On Thu, Jun 07, 2012 at 05:34:25PM +0200, Matthias N?bel wrote:> i have a problem with the wildcardsearch (Flag 'FLAG_WILDCARD' > activated) and words with a hyphen. > > Here is a small test script: > http://psserver.fdog.de/test_mn/xap_test.php > > If the wilcard is set before the hyphen, everthing is fine. > Is the wildcard placed after the hyphen (test-w*) the wildcard has no effect.A hyphenated sequence of words is handled as phrase search, and wildcards aren't supported in phrase searches (not currently, at least). The case ?test*-w? is actually just handled as if the hyphen wasn't present. Perhaps it would be better to handle ?test-w*? the same way, though I don't know how easy that would be to do.> Is there anything i can do? Escaping, setting additional Flags, ...? > Maybe someone had the problem as well and knows workarround?The only workaround I can think of is to remove the hyphen, assuming that gives an acceptable parse. Cheers, Olly