added code to specifically index/search file names

This commit is contained in:
dockes
2006-03-20 16:05:41 +00:00
parent f96fcd6dd3
commit d4852f3b0d
10 changed files with 259 additions and 145 deletions
+6 -1
View File
@@ -1,5 +1,5 @@
#ifndef lint
static char rcsid[] = "@(#$Id: indexer.cpp,v 1.24 2006-01-26 07:02:06 dockes Exp $ (C) 2004 J.F.Dockes";
static char rcsid[] = "@(#$Id: indexer.cpp,v 1.25 2006-03-20 16:05:41 dockes Exp $ (C) 2004 J.F.Dockes";
#endif
/*
* This program is free software; you can redistribute it and/or modify
@@ -236,6 +236,11 @@ DbIndexer::processone(const std::string &fn, const struct stat *stp,
// Internal access path for multi-document files
doc.ipath = ipath;
// File name transcoded to utf8 for indexation.
// We actually might want a separate param for the filename charset
string charset = config->getDefCharset();
// If this fails, the path won't be indexed, no big deal
transcode(fn, doc.utf8fn, charset, "UTF-8");
// Do database-specific work to update document data
if (!db.add(fn, doc, stp))
return FsTreeWalker::FtwError;