query-parser: special-case wildcards
We were transforming wild-card searches into regular-expression searches; while that works, it's also significantly slower. So, instead, special-case wildcards, and use the Xapian machinery for wildcard queries.
This commit is contained in:
@ -167,14 +167,9 @@ data (Mux::Tokens& tokens, ProcPtr proc, WarningVec& warnings)
|
||||
}
|
||||
|
||||
// does it look like a regexp?
|
||||
if (val.length()>=2) {
|
||||
if (val[0]=='/' && val[val.length()-1] == '/')
|
||||
if (val.length() >=2 )
|
||||
if (val[0] == '/' && val[val.length()-1] == '/')
|
||||
return regex (fields, val, token.pos, proc, warnings);
|
||||
else if (val[val.length()-1] == '*')
|
||||
return regex (fields, // transfrom wildcard into regexp
|
||||
"/" + val.substr(0, val.length()-1) + ".*/",
|
||||
token.pos, proc, warnings);
|
||||
}
|
||||
|
||||
// does it look like a range?
|
||||
const auto dotdot = val.find("..");
|
||||
|
||||
Reference in New Issue
Block a user