|
a/src/index/fsindexer.cpp |
|
b/src/index/fsindexer.cpp |
|
... |
|
... |
176 |
}
|
176 |
}
|
177 |
return true;
|
177 |
return true;
|
178 |
}
|
178 |
}
|
179 |
|
179 |
|
180 |
// Recursively index each directory in the topdirs:
|
180 |
// Recursively index each directory in the topdirs:
|
181 |
bool FsIndexer::index()
|
181 |
bool FsIndexer::index(bool quickshallow)
|
182 |
{
|
182 |
{
|
183 |
Chrono chron;
|
183 |
Chrono chron;
|
184 |
if (!init())
|
184 |
if (!init())
|
185 |
return false;
|
185 |
return false;
|
186 |
|
186 |
|
|
... |
|
... |
191 |
m_updater->status.reset();
|
191 |
m_updater->status.reset();
|
192 |
m_updater->status.dbtotdocs = m_db->docCnt();
|
192 |
m_updater->status.dbtotdocs = m_db->docCnt();
|
193 |
}
|
193 |
}
|
194 |
|
194 |
|
195 |
m_walker.setSkippedPaths(m_config->getSkippedPaths());
|
195 |
m_walker.setSkippedPaths(m_config->getSkippedPaths());
|
|
|
196 |
if (quickshallow) {
|
|
|
197 |
m_walker.setOpts(m_walker.getOpts() | FsTreeWalker::FtwSkipDotFiles);
|
|
|
198 |
m_walker.setMaxDepth(2);
|
|
|
199 |
}
|
|
|
200 |
|
196 |
for (vector<string>::const_iterator it = m_tdl.begin();
|
201 |
for (vector<string>::const_iterator it = m_tdl.begin();
|
197 |
it != m_tdl.end(); it++) {
|
202 |
it != m_tdl.end(); it++) {
|
198 |
LOGDEB(("FsIndexer::index: Indexing %s into %s\n", it->c_str(),
|
203 |
LOGDEB(("FsIndexer::index: Indexing %s into %s\n", it->c_str(),
|
199 |
getDbDir().c_str()));
|
204 |
getDbDir().c_str()));
|
200 |
|
205 |
|
|
... |
|
... |
202 |
// getConfParams() will get local values
|
207 |
// getConfParams() will get local values
|
203 |
m_config->setKeyDir(*it);
|
208 |
m_config->setKeyDir(*it);
|
204 |
|
209 |
|
205 |
// Adjust the "follow symlinks" option
|
210 |
// Adjust the "follow symlinks" option
|
206 |
bool follow;
|
211 |
bool follow;
|
|
|
212 |
int opts = m_walker.getOpts();
|
207 |
if (m_config->getConfParam("followLinks", &follow) && follow) {
|
213 |
if (m_config->getConfParam("followLinks", &follow) && follow) {
|
208 |
m_walker.setOpts(FsTreeWalker::FtwFollow);
|
214 |
opts |= FsTreeWalker::FtwFollow;
|
209 |
} else {
|
215 |
} else {
|
210 |
m_walker.setOpts(FsTreeWalker::FtwOptNone);
|
216 |
opts &= ~FsTreeWalker::FtwFollow;
|
211 |
}
|
217 |
}
|
|
|
218 |
m_walker.setOpts(opts);
|
212 |
|
219 |
|
213 |
int abslen;
|
220 |
int abslen;
|
214 |
if (m_config->getConfParam("idxabsmlen", &abslen))
|
221 |
if (m_config->getConfParam("idxabsmlen", &abslen))
|
215 |
m_db->setAbstractParams(abslen, -1, -1);
|
222 |
m_db->setAbstractParams(abslen, -1, -1);
|
216 |
|
223 |
|