recollindex -l
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#ifndef lint
|
||||
static char rcsid[] = "@(#$Id: indexer.cpp,v 1.59 2007-06-11 05:38:00 dockes Exp $ (C) 2004 J.F.Dockes";
|
||||
static char rcsid[] = "@(#$Id: indexer.cpp,v 1.60 2007-07-10 09:23:27 dockes Exp $ (C) 2004 J.F.Dockes";
|
||||
#endif
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -71,6 +71,11 @@ DbIndexer::~DbIndexer() {
|
||||
m_db.close();
|
||||
}
|
||||
|
||||
list<string> DbIndexer::getStemmerNames()
|
||||
{
|
||||
return Rcl::Db::getStemmerNames();
|
||||
}
|
||||
|
||||
// Index each directory in the topdirs for a given db
|
||||
bool DbIndexer::indexDb(bool resetbefore, list<string> *topdirs)
|
||||
{
|
||||
|
||||
+4
-1
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
#ifndef _INDEXER_H_INCLUDED_
|
||||
#define _INDEXER_H_INCLUDED_
|
||||
/* @(#$Id: indexer.h,v 1.23 2007-02-08 17:05:12 dockes Exp $ (C) 2004 J.F.Dockes */
|
||||
/* @(#$Id: indexer.h,v 1.24 2007-07-10 09:23:28 dockes Exp $ (C) 2004 J.F.Dockes */
|
||||
|
||||
#include <string>
|
||||
#include <list>
|
||||
@@ -136,6 +136,9 @@ class DbIndexer : public FsTreeWalkerCB {
|
||||
/** Return my db dir */
|
||||
string getDbDir() {return m_dbdir;}
|
||||
|
||||
/** List possible stemmer names */
|
||||
static list<string> getStemmerNames();
|
||||
|
||||
private:
|
||||
FsTreeWalker m_walker;
|
||||
RclConfig *m_config;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef lint
|
||||
static char rcsid[] = "@(#$Id: recollindex.cpp,v 1.33 2007-06-08 16:47:19 dockes Exp $ (C) 2004 J.F.Dockes";
|
||||
static char rcsid[] = "@(#$Id: recollindex.cpp,v 1.34 2007-07-10 09:23:28 dockes Exp $ (C) 2004 J.F.Dockes";
|
||||
#endif
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -216,6 +216,7 @@ static int op_flags;
|
||||
#define OPT_e 0x200
|
||||
#define OPT_w 0x400
|
||||
#define OPT_x 0x800
|
||||
#define OPT_l 0x1000
|
||||
|
||||
static const char usage [] =
|
||||
"\n"
|
||||
@@ -234,6 +235,8 @@ static const char usage [] =
|
||||
" Purge data for individual files. No stem database updates\n"
|
||||
"recollindex -i <filename [filename ...]>\n"
|
||||
" Index individual files. No database purge or stem database updates\n"
|
||||
"recollindex -l\n"
|
||||
" List available stemming languages\n"
|
||||
"recollindex -s <lang>\n"
|
||||
" Build stem database for additional language <lang>\n"
|
||||
#ifdef RCL_USE_ASPELL
|
||||
@@ -282,6 +285,7 @@ int main(int argc, const char **argv)
|
||||
case 'e': op_flags |= OPT_e; break;
|
||||
case 'h': op_flags |= OPT_h; break;
|
||||
case 'i': op_flags |= OPT_i; break;
|
||||
case 'l': op_flags |= OPT_l; break;
|
||||
#ifdef RCL_MONITOR
|
||||
case 'm': op_flags |= OPT_m; break;
|
||||
#endif
|
||||
@@ -338,6 +342,15 @@ int main(int argc, const char **argv)
|
||||
else
|
||||
exit(!purgefiles(config, filenames));
|
||||
|
||||
} else if (op_flags & OPT_l) {
|
||||
if (argc != 0)
|
||||
Usage();
|
||||
list<string> stemmers = DbIndexer::getStemmerNames();
|
||||
for (list<string>::const_iterator it = stemmers.begin();
|
||||
it != stemmers.end(); it++) {
|
||||
cout << *it << endl;
|
||||
}
|
||||
exit(0);
|
||||
} else if (op_flags & OPT_s) {
|
||||
if (argc != 1)
|
||||
Usage();
|
||||
|
||||
Reference in New Issue
Block a user