diff --git a/src/common/cstr.h b/src/common/cstr.h index 4bbf1bd0..e13950cd 100644 --- a/src/common/cstr.h +++ b/src/common/cstr.h @@ -58,6 +58,9 @@ DEF_CSTR(textplain, "text/plain"); DEF_CSTR(url, "url"); // Marker for HTML format fields 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 // used to store all data generated by format-translating filters. It is diff --git a/src/rcldb/rcldb.cpp b/src/rcldb/rcldb.cpp index cce8f2a8..7050d197 100644 --- a/src/rcldb/rcldb.cpp +++ b/src/rcldb/rcldb.cpp @@ -1693,12 +1693,6 @@ static void addPrefix(vector& terms, const string& 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 // If field is set, we return a list of appropriately prefixed terms (which // are going to be used to build a Xapian query). @@ -1729,7 +1723,8 @@ bool Db::termMatch(MatchType typ, const string &lang, return false; } - string nochars = typ == ET_WILD ? cstr_wildSpecChars : cstr_regSpecChars; + string nochars = typ == ET_WILD ? cstr_wildSpecStChars : + cstr_regSpecStChars; string prefix; if (!field.empty()) {