Switch to unified view

a/src/index/indexer.cpp b/src/index/indexer.cpp
1
#ifndef lint
1
#ifndef lint
2
static char rcsid[] = "@(#$Id: indexer.cpp,v 1.40 2006-10-24 09:09:36 dockes Exp $ (C) 2004 J.F.Dockes";
2
static char rcsid[] = "@(#$Id: indexer.cpp,v 1.41 2006-10-24 14:28:38 dockes Exp $ (C) 2004 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
...
...
113
113
114
    // Get rid of all database entries that don't exist in the
114
    // Get rid of all database entries that don't exist in the
115
    // filesystem anymore.
115
    // filesystem anymore.
116
    m_db.purge();
116
    m_db.purge();
117
117
118
    createStemmingDatabases();
119
    createAspellDict();
120
121
    // The close would be done in our destructor, but we want status here
122
    if (m_updater) {
123
  m_updater->status.phase = DbIxStatus::DBIXS_CLOSING;
124
  m_updater->status.fn.erase();
125
  m_updater->update();
126
    }
127
    if (!m_db.close()) {
128
  LOGERR(("DbIndexer::index: error closing database in %s\n", 
129
      m_dbdir.c_str()));
130
  return false;
131
    }
132
    return true;
133
}
134
118
    // Create stemming databases. We also remove those which are not
135
// Create stemming databases. We also remove those which are not
119
    // configured.
136
// configured.
137
bool DbIndexer::createStemmingDatabases()
138
{
120
    string slangs;
139
    string slangs;
121
    if (m_config->getConfParam("indexstemminglanguages", slangs)) {
140
    if (m_config->getConfParam("indexstemminglanguages", slangs)) {
122
    list<string> langs;
141
    list<string> langs;
123
    stringToStrings(slangs, langs);
142
    stringToStrings(slangs, langs);
124
143
...
...
136
        m_updater->status.fn = *it;
155
        m_updater->status.fn = *it;
137
        m_updater->update();
156
        m_updater->update();
138
        }
157
        }
139
        m_db.createStemDb(*it);
158
        m_db.createStemDb(*it);
140
    }
159
    }
141
    }
142
143
    createAspellDict();
144
145
    // The close would be done in our destructor, but we want status here
146
    if (m_updater) {
147
  m_updater->status.phase = DbIxStatus::DBIXS_CLOSING;
148
  m_updater->status.fn.erase();
149
  m_updater->update();
150
    }
151
    if (!m_db.close()) {
152
  LOGERR(("DbIndexer::index: error closing database in %s\n", 
153
      m_dbdir.c_str()));
154
  return false;
155
    }
160
    }
156
    return true;
161
    return true;
157
}
162
}
158
163
159
bool DbIndexer::init(bool resetbefore)
164
bool DbIndexer::init(bool resetbefore)