Added option -P to recollindex to force purge pass with -i
This commit is contained in:
parent
b4f3cf35b0
commit
90dab89303
@ -40,40 +40,25 @@ recollindex \- indexing command for the Recoll full text search system
|
|||||||
.B \-n|-k
|
.B \-n|-k
|
||||||
]
|
]
|
||||||
.br
|
.br
|
||||||
.B recollindex
|
.B recollindex
|
||||||
[
|
[
|
||||||
.B \-c
|
.B \-c
|
||||||
<cd>
|
<cd>
|
||||||
]
|
]
|
||||||
.B \-i
|
.B \-i
|
||||||
[
|
[
|
||||||
.B \-Z
|
.B \-Z \-k \-f \-P
|
||||||
]
|
|
||||||
[
|
|
||||||
.B \-k
|
|
||||||
]
|
|
||||||
[
|
|
||||||
.B \-f
|
|
||||||
]
|
]
|
||||||
[<path [path ...]>]
|
[<path [path ...]>]
|
||||||
.br
|
.br
|
||||||
.B recollindex
|
.B recollindex
|
||||||
[
|
[
|
||||||
.B \-c
|
.B \-c
|
||||||
<configdir>
|
<cd>
|
||||||
]
|
]
|
||||||
.B \-r
|
.B \-r
|
||||||
[
|
[
|
||||||
.B \-Z
|
.B \-Z \-K \-e \-f
|
||||||
]
|
|
||||||
[
|
|
||||||
.B \-K
|
|
||||||
]
|
|
||||||
[
|
|
||||||
.B \-e
|
|
||||||
]
|
|
||||||
[
|
|
||||||
.B \-f
|
|
||||||
]
|
]
|
||||||
[
|
[
|
||||||
.B \-p
|
.B \-p
|
||||||
@ -121,8 +106,7 @@ pattern
|
|||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
The
|
The
|
||||||
.B recollindex
|
.B recollindex
|
||||||
utility allows you to perform indexing operations for the Recoll text
|
command is the Recoll indexer.
|
||||||
search system.
|
|
||||||
.PP
|
.PP
|
||||||
As indexing can sometimes take a long time, the command can be interrupted
|
As indexing can sometimes take a long time, the command can be interrupted
|
||||||
by sending an interrupt (Ctrl-C, SIGINT) or terminate (SIGTERM)
|
by sending an interrupt (Ctrl-C, SIGINT) or terminate (SIGTERM)
|
||||||
@ -207,12 +191,14 @@ configuration variables will be used, so that some files may be
|
|||||||
skipped. You can tell recollindex to ignore skippedPaths and skippedNames
|
skipped. You can tell recollindex to ignore skippedPaths and skippedNames
|
||||||
by setting the
|
by setting the
|
||||||
.B
|
.B
|
||||||
\-f
|
\-f option. This allows fully custom file selection for a given subtree,
|
||||||
option. This allows fully custom file selection for a given subtree,
|
|
||||||
for which you would add the top directory to skippedPaths, and use any
|
for which you would add the top directory to skippedPaths, and use any
|
||||||
custom tool to generate the file list (ie: a tool from a source code
|
custom tool to generate the file list (ie: a tool from a source code
|
||||||
control system).
|
control system). When run this way, the indexer normally does not perform
|
||||||
.PP
|
the deleted files purge pass, because it cannot be sure to have seen all
|
||||||
|
the existing files. You can force a purge pass with
|
||||||
|
.B
|
||||||
|
\-P.
|
||||||
.PP
|
.PP
|
||||||
.B recollindex \-e
|
.B recollindex \-e
|
||||||
will erase data for individual files from the database. The stem expansion
|
will erase data for individual files from the database. The stem expansion
|
||||||
|
|||||||
@ -211,6 +211,9 @@ bool ConfIndexer::indexFiles(list<string>& ifiles, int flag)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
if (flag & IxFDoPurge) {
|
||||||
|
m_db.purge();
|
||||||
|
}
|
||||||
// The close would be done in our destructor, but we want status here
|
// The close would be done in our destructor, but we want status here
|
||||||
if (!m_db.close()) {
|
if (!m_db.close()) {
|
||||||
LOGERR("ConfIndexer::index: error closing database in " <<
|
LOGERR("ConfIndexer::index: error closing database in " <<
|
||||||
|
|||||||
@ -107,6 +107,9 @@ class ConfIndexer {
|
|||||||
IxFQuickShallow = 4,
|
IxFQuickShallow = 4,
|
||||||
// Do not retry files which previously failed ('+' sigs)
|
// Do not retry files which previously failed ('+' sigs)
|
||||||
IxFNoRetryFailed = 8,
|
IxFNoRetryFailed = 8,
|
||||||
|
// Do perform purge pass even if we can't be sure we saw
|
||||||
|
// all files
|
||||||
|
IxFDoPurge = 16,
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Run indexers */
|
/** Run indexers */
|
||||||
|
|||||||
@ -61,28 +61,31 @@ using namespace std;
|
|||||||
// Command line options
|
// Command line options
|
||||||
static int op_flags;
|
static int op_flags;
|
||||||
#define OPT_MOINS 0x1
|
#define OPT_MOINS 0x1
|
||||||
#define OPT_C 0x2
|
#define OPT_C 0x1
|
||||||
#define OPT_D 0x4
|
#define OPT_D 0x2
|
||||||
#define OPT_E 0x8
|
#define OPT_E 0x4
|
||||||
#define OPT_K 0x10
|
#define OPT_K 0x8
|
||||||
#define OPT_R 0x20
|
#define OPT_P 0x10
|
||||||
#define OPT_S 0x40
|
#define OPT_R 0x20
|
||||||
#define OPT_Z 0x80
|
#define OPT_S 0x40
|
||||||
#define OPT_b 0x100
|
#define OPT_Z 0x80
|
||||||
#define OPT_c 0x200
|
#define OPT_b 0x100
|
||||||
#define OPT_e 0x400
|
#define OPT_c 0x200
|
||||||
#define OPT_f 0x800
|
#define OPT_e 0x400
|
||||||
#define OPT_h 0x1000
|
#define OPT_f 0x800
|
||||||
#define OPT_i 0x2000
|
#define OPT_h 0x1000
|
||||||
#define OPT_k 0x4000
|
#define OPT_i 0x2000
|
||||||
#define OPT_l 0x8000
|
#define OPT_k 0x4000
|
||||||
#define OPT_m 0x10000
|
#define OPT_l 0x8000
|
||||||
#define OPT_n 0x20000
|
#define OPT_m 0x10000
|
||||||
#define OPT_r 0x40000
|
#define OPT_n 0x20000
|
||||||
#define OPT_s 0x80000
|
#define OPT_p 0x40000
|
||||||
#define OPT_w 0x100000
|
#define OPT_r 0x80000
|
||||||
#define OPT_x 0x200000
|
#define OPT_s 0x100000
|
||||||
#define OPT_z 0x400000
|
#define OPT_w 0x200000
|
||||||
|
#define OPT_x 0x400000
|
||||||
|
#define OPT_z 0x800000
|
||||||
|
|
||||||
ReExec *o_reexec;
|
ReExec *o_reexec;
|
||||||
|
|
||||||
// Globals for atexit cleanup
|
// Globals for atexit cleanup
|
||||||
@ -261,6 +264,9 @@ bool indexfiles(RclConfig *config, list<string> &filenames)
|
|||||||
indexerFlags |= ConfIndexer::IxFNoRetryFailed;
|
indexerFlags |= ConfIndexer::IxFNoRetryFailed;
|
||||||
if (op_flags & OPT_f)
|
if (op_flags & OPT_f)
|
||||||
indexerFlags |= ConfIndexer::IxFIgnoreSkip;
|
indexerFlags |= ConfIndexer::IxFIgnoreSkip;
|
||||||
|
if (op_flags & OPT_P) {
|
||||||
|
indexerFlags |= ConfIndexer::IxFDoPurge;
|
||||||
|
}
|
||||||
return confindexer->indexFiles(filenames, indexerFlags);
|
return confindexer->indexFiles(filenames, indexerFlags);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -351,10 +357,12 @@ static const char usage [] =
|
|||||||
" -x disables exit on end of x11 session\n"
|
" -x disables exit on end of x11 session\n"
|
||||||
#endif /* DISABLE_X11MON */
|
#endif /* DISABLE_X11MON */
|
||||||
#endif /* RCL_MONITOR */
|
#endif /* RCL_MONITOR */
|
||||||
"recollindex -e <filename [filename ...]>\n"
|
"recollindex -e [<filepath [path ...]>]\n"
|
||||||
" Purge data for individual files. No stem database updates\n"
|
" Purge data for individual files. No stem database updates.\n"
|
||||||
"recollindex -i [-f] [-Z] <filename [filename ...]>\n"
|
" Reads paths on stdin if none is given as argument.\n"
|
||||||
|
"recollindex -i [-f] [-Z] [<filepath [path ...]>]\n"
|
||||||
" Index individual files. No database purge or stem database updates\n"
|
" Index individual files. No database purge or stem database updates\n"
|
||||||
|
" Will read paths on stdin if none is given as argument\n"
|
||||||
" -f : ignore skippedPaths and skippedNames while doing this\n"
|
" -f : ignore skippedPaths and skippedNames while doing this\n"
|
||||||
"recollindex -r [-K] [-f] [-Z] [-p pattern] <top> \n"
|
"recollindex -r [-K] [-f] [-Z] [-p pattern] <top> \n"
|
||||||
" Recursive partial reindex. \n"
|
" Recursive partial reindex. \n"
|
||||||
@ -468,7 +476,8 @@ int main(int argc, char **argv)
|
|||||||
case 'l': op_flags |= OPT_l; break;
|
case 'l': op_flags |= OPT_l; break;
|
||||||
case 'm': op_flags |= OPT_m; break;
|
case 'm': op_flags |= OPT_m; break;
|
||||||
case 'n': op_flags |= OPT_n; break;
|
case 'n': op_flags |= OPT_n; break;
|
||||||
case 'p': if (argc < 2) Usage();
|
case 'P': op_flags |= OPT_P; break;
|
||||||
|
case 'p': op_flags |= OPT_p; if (argc < 2) Usage();
|
||||||
selpatterns.push_back(*(++argv));
|
selpatterns.push_back(*(++argv));
|
||||||
argc--; goto b1;
|
argc--; goto b1;
|
||||||
case 'r': op_flags |= OPT_r; break;
|
case 'r': op_flags |= OPT_r; break;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user