[Xapian-discuss] Wildcardsearch with words with a hyphen

Olly Betts olly at survex.com
Fri Jun 8 00:45:27 BST 2012


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



More information about the Xapian-discuss mailing list