wild/reg spe chars defs moved to cstr
This commit is contained in:
parent
5a7a1b232e
commit
69aa57d182
@ -58,6 +58,9 @@ DEF_CSTR(textplain, "text/plain");
|
|||||||
DEF_CSTR(url, "url");
|
DEF_CSTR(url, "url");
|
||||||
// Marker for HTML format fields
|
// Marker for HTML format fields
|
||||||
DEF_CSTR(fldhtm, "\007");
|
DEF_CSTR(fldhtm, "\007");
|
||||||
|
// Characters that can -begin- a wildcard or regexp expression.
|
||||||
|
DEF_CSTR(wildSpecStChars, "*?[");
|
||||||
|
DEF_CSTR(regSpecStChars, "(.[{");
|
||||||
|
|
||||||
// Values used as keys inside Dijon::Filter::metaData[]. This structure is
|
// Values used as keys inside Dijon::Filter::metaData[]. This structure is
|
||||||
// used to store all data generated by format-translating filters. It is
|
// used to store all data generated by format-translating filters. It is
|
||||||
|
|||||||
@ -1693,12 +1693,6 @@ static void addPrefix(vector<TermMatchEntry>& terms, const string& prefix)
|
|||||||
it->term.insert(0, prefix);
|
it->term.insert(0, prefix);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Characters that can begin a wildcard or regexp expression. We use skipto
|
|
||||||
// to begin the allterms search with terms that begin with the portion of
|
|
||||||
// the input string prior to these chars.
|
|
||||||
const string cstr_wildSpecChars = "*?[";
|
|
||||||
const string cstr_regSpecChars = "(.[{";
|
|
||||||
|
|
||||||
// Find all index terms that match a wildcard or regular expression
|
// Find all index terms that match a wildcard or regular expression
|
||||||
// If field is set, we return a list of appropriately prefixed terms (which
|
// If field is set, we return a list of appropriately prefixed terms (which
|
||||||
// are going to be used to build a Xapian query).
|
// are going to be used to build a Xapian query).
|
||||||
@ -1729,7 +1723,8 @@ bool Db::termMatch(MatchType typ, const string &lang,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
string nochars = typ == ET_WILD ? cstr_wildSpecChars : cstr_regSpecChars;
|
string nochars = typ == ET_WILD ? cstr_wildSpecStChars :
|
||||||
|
cstr_regSpecStChars;
|
||||||
|
|
||||||
string prefix;
|
string prefix;
|
||||||
if (!field.empty()) {
|
if (!field.empty()) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user