GUI: only do the result up to date check before preview for the main index (we cant update the others anyway)
This commit is contained in:
parent
f8c9452228
commit
822acc79d2
3 changed files with 24 additions and 5 deletions
|
@ -1171,7 +1171,7 @@ void RclMain::startPreview(int docnum, Rcl::Doc doc, int mod)
|
||||||
// from a compacted mail folder)
|
// from a compacted mail folder)
|
||||||
//
|
//
|
||||||
// !! NOTE: there is one case where doing a partial index update
|
// !! NOTE: there is one case where doing a partial index update
|
||||||
// will not worl: if the search result does not exist in the new
|
// will not work: if the search result does not exist in the new
|
||||||
// version of the file, it won't be purged from the index because
|
// version of the file, it won't be purged from the index because
|
||||||
// a partial index pass does no purge, so its ref date will stay
|
// a partial index pass does no purge, so its ref date will stay
|
||||||
// the same and you keep getting the message about the index being
|
// the same and you keep getting the message about the index being
|
||||||
|
@ -1179,11 +1179,15 @@ void RclMain::startPreview(int docnum, Rcl::Doc doc, int mod)
|
||||||
// indexing pass.
|
// indexing pass.
|
||||||
// Also we should re-run the query after updating the index
|
// Also we should re-run the query after updating the index
|
||||||
// because the ipaths may be wrong in the current result list
|
// because the ipaths may be wrong in the current result list
|
||||||
if (!doc.ipath.empty()) {
|
// We only do this for the main index, else jump and prey (cant
|
||||||
string udi, sig;
|
// update anyway, even the makesig() call might not make sense for
|
||||||
|
// our base config)
|
||||||
|
if (!doc.ipath.empty() && rcldb && rcldb->whatDbIdx(doc) == 0) {
|
||||||
|
string udi;
|
||||||
doc.getmeta(Rcl::Doc::keyudi, &udi);
|
doc.getmeta(Rcl::Doc::keyudi, &udi);
|
||||||
FileInterner::makesig(doc, sig);
|
if (!udi.empty()) {
|
||||||
if (rcldb && !udi.empty()) {
|
string sig;
|
||||||
|
FileInterner::makesig(doc, sig);
|
||||||
if (rcldb->needUpdate(udi, sig)) {
|
if (rcldb->needUpdate(udi, sig)) {
|
||||||
int rep =
|
int rep =
|
||||||
QMessageBox::warning(0, tr("Warning"),
|
QMessageBox::warning(0, tr("Warning"),
|
||||||
|
|
|
@ -841,6 +841,16 @@ bool Db::rmQueryDb(const string &dir)
|
||||||
return adjustdbs();
|
return adjustdbs();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Determining what index a doc result comes from is based on the
|
||||||
|
// modulo of the docid against the db count. Ref:
|
||||||
|
// http://trac.xapian.org/wiki/FAQ/MultiDatabaseDocumentID
|
||||||
|
size_t Db::whatDbIdx(const Doc& doc)
|
||||||
|
{
|
||||||
|
if (doc.xdocid == 0)
|
||||||
|
return (size_t)-1;
|
||||||
|
return doc.xdocid % m_extraDbs.size();
|
||||||
|
}
|
||||||
|
|
||||||
bool Db::testDbDir(const string &dir)
|
bool Db::testDbDir(const string &dir)
|
||||||
{
|
{
|
||||||
string aerr;
|
string aerr;
|
||||||
|
|
|
@ -197,6 +197,11 @@ class Db {
|
||||||
bool addQueryDb(const string &dir);
|
bool addQueryDb(const string &dir);
|
||||||
/** Remove extra database. if dir == "", remove all. */
|
/** Remove extra database. if dir == "", remove all. */
|
||||||
bool rmQueryDb(const string &dir);
|
bool rmQueryDb(const string &dir);
|
||||||
|
/** Look where the doc result comes from.
|
||||||
|
* @return: 0 main index, (size_t)-1 don't know,
|
||||||
|
* other: order of database in add_database() sequence.
|
||||||
|
*/
|
||||||
|
size_t whatDbIdx(const Doc& doc);
|
||||||
/** Tell if directory seems to hold xapian db */
|
/** Tell if directory seems to hold xapian db */
|
||||||
static bool testDbDir(const string &dir);
|
static bool testDbDir(const string &dir);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue