|
a/src/rcldb/searchdata.cpp |
|
b/src/rcldb/searchdata.cpp |
1 |
#ifndef lint
|
1 |
#ifndef lint
|
2 |
static char rcsid[] = "@(#$Id: searchdata.cpp,v 1.19 2007-10-04 12:26:04 dockes Exp $ (C) 2006 J.F.Dockes";
|
2 |
static char rcsid[] = "@(#$Id: searchdata.cpp,v 1.20 2008-01-16 08:43:26 dockes Exp $ (C) 2006 J.F.Dockes";
|
3 |
#endif
|
3 |
#endif
|
4 |
/*
|
4 |
/*
|
5 |
* This program is free software; you can redistribute it and/or modify
|
5 |
* This program is free software; you can redistribute it and/or modify
|
6 |
* it under the terms of the GNU General Public License as published by
|
6 |
* it under the terms of the GNU General Public License as published by
|
7 |
* the Free Software Foundation; either version 2 of the License, or
|
7 |
* the Free Software Foundation; either version 2 of the License, or
|
|
... |
|
... |
542 |
const string&)
|
542 |
const string&)
|
543 |
{
|
543 |
{
|
544 |
Xapian::Query *qp = (Xapian::Query *)p;
|
544 |
Xapian::Query *qp = (Xapian::Query *)p;
|
545 |
*qp = Xapian::Query();
|
545 |
*qp = Xapian::Query();
|
546 |
|
546 |
|
|
|
547 |
list<string> patterns;
|
|
|
548 |
stringToStrings(m_text, patterns);
|
547 |
list<string> names;
|
549 |
list<string> names;
|
|
|
550 |
for (list<string>::iterator it = patterns.begin();
|
|
|
551 |
it != patterns.end(); it++) {
|
|
|
552 |
// This relies on filenameWildExp not resetting and always
|
|
|
553 |
// adding to the input
|
548 |
db.filenameWildExp(m_text, names);
|
554 |
db.filenameWildExp(*it, names);
|
|
|
555 |
}
|
549 |
// Build a query out of the matching file name terms.
|
556 |
// Build a query out of the matching file name terms.
|
550 |
*qp = Xapian::Query(Xapian::Query::OP_OR, names.begin(), names.end());
|
557 |
*qp = Xapian::Query(Xapian::Query::OP_OR, names.begin(), names.end());
|
551 |
return true;
|
558 |
return true;
|
552 |
}
|
559 |
}
|
553 |
|
560 |
|