filenames used for "filename search" need to be lowercased and stripped
This commit is contained in:
parent
7c76d34b05
commit
b57f483a30
2 changed files with 12 additions and 1 deletions
|
@ -536,6 +536,8 @@ bool Db::rmQueryDb(const string &dir)
|
||||||
// http://trac.xapian.org/wiki/FAQ/MultiDatabaseDocumentID
|
// http://trac.xapian.org/wiki/FAQ/MultiDatabaseDocumentID
|
||||||
size_t Db::whatDbIdx(const Doc& doc)
|
size_t Db::whatDbIdx(const Doc& doc)
|
||||||
{
|
{
|
||||||
|
LOGDEB(("Db::whatDbIdx: xdocid %lu, %u extraDbs\n",
|
||||||
|
(unsigned long)doc.xdocid, m_extraDbs.size()));
|
||||||
if (doc.xdocid == 0)
|
if (doc.xdocid == 0)
|
||||||
return (size_t)-1;
|
return (size_t)-1;
|
||||||
if (m_extraDbs.size() == 0)
|
if (m_extraDbs.size() == 0)
|
||||||
|
@ -1448,6 +1450,15 @@ bool Db::filenameWildExp(const string& fnexp, vector<string>& names, int max)
|
||||||
|
|
||||||
LOGDEB(("Rcl::Db::filenameWildExp: pattern: [%s]\n", pattern.c_str()));
|
LOGDEB(("Rcl::Db::filenameWildExp: pattern: [%s]\n", pattern.c_str()));
|
||||||
|
|
||||||
|
// We inconditionnally lowercase and strip the pattern, as is done
|
||||||
|
// during indexing. This seems to be the only sane possible
|
||||||
|
// approach with file names and wild cards. termMatch does
|
||||||
|
// stripping conditionally on indexstripchars.
|
||||||
|
string pat1;
|
||||||
|
if (unacmaybefold(pattern, pat1, "UTF-8", UNACOP_UNACFOLD)) {
|
||||||
|
pattern.swap(pat1);
|
||||||
|
}
|
||||||
|
|
||||||
TermMatchResult result;
|
TermMatchResult result;
|
||||||
if (!termMatch(ET_WILD, string(), pattern, result, max,
|
if (!termMatch(ET_WILD, string(), pattern, result, max,
|
||||||
unsplitFilenameFieldName))
|
unsplitFilenameFieldName))
|
||||||
|
|
|
@ -1270,7 +1270,7 @@ bool SearchDataClauseSimple::toNativeQuery(Rcl::Db &db, void *p,
|
||||||
// the generic field-processing code.
|
// the generic field-processing code.
|
||||||
//
|
//
|
||||||
// We do not split the entry any more (used to do some crazy thing
|
// We do not split the entry any more (used to do some crazy thing
|
||||||
// about expanding multiple fragments in the past. We just take the
|
// about expanding multiple fragments in the past). We just take the
|
||||||
// value blanks and all and expand this against the indexed unsplit
|
// value blanks and all and expand this against the indexed unsplit
|
||||||
// file names
|
// file names
|
||||||
bool SearchDataClauseFilename::toNativeQuery(Rcl::Db &db, void *p,
|
bool SearchDataClauseFilename::toNativeQuery(Rcl::Db &db, void *p,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue