From: Art Cancro Date: Mon, 24 Jul 2023 15:25:57 +0000 (-0900) Subject: export fulltext records X-Git-Tag: v987~10 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=8d216678047969767e469e2034da450760763711;p=citadel.git export fulltext records --- diff --git a/citadel/utils/ctdldump.c b/citadel/utils/ctdldump.c index 4ad01e3de..1360da059 100644 --- a/citadel/utils/ctdldump.c +++ b/citadel/utils/ctdldump.c @@ -216,8 +216,8 @@ void export_floor(int which_cdb, DBT *in_key, DBT *in_data) { } -// export function for a msglist or a fulltext index record -// (both are indexed by a long and the data is arrays of longs) +// export function for a msglist +// (indexed by a long and the data is arrays of longs) void export_msglist(int which_cdb, DBT *in_key, DBT *in_data) { int i; int num_msgs; @@ -243,6 +243,33 @@ void export_msglist(int which_cdb, DBT *in_key, DBT *in_data) { } +// export function for a full text search index record +// (indexed by an int and the data is arrays of longs) +void export_fulltext(int which_cdb, DBT *in_key, DBT *in_data) { + int i; + int num_msgs; + long msg; + + // records are indexed by a single "int" and contains an array of zero or more "long"s + int indexnum; + memcpy(&indexnum, in_key->data, sizeof(int)); + + printf("fulltext|%d|", indexnum); + + if (in_data->size > 0) { + num_msgs = in_data->size / sizeof(long); + for (i=0; idata + (i * sizeof(long))), sizeof(long)); + if (i != 0) { + printf(","); + } + printf("%ld", msg); + } + } + printf("|\n"); +} + + // export function for a visit record void export_visit(int which_cdb, DBT *in_key, DBT *in_data) { struct visit *visit = (struct visit *)in_data->data; @@ -364,7 +391,7 @@ void (*export_functions[])(int which_cdb, DBT *in_key, DBT *in_data) = { export_dir, // CDB_DIRECTORY export_usetable, // CDB_USETABLE export_bigmsg, // CDB_BIGMSGS - zero_function, // CDB_FULLTEXT + export_fulltext, // CDB_FULLTEXT zero_function, // CDB_EUIDINDEX export_usersbynumber, // CDB_USERSBYNUMBER zero_function, // CDB_UNUSED1 (obsolete)