projects
/
citadel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of ssh://git.citadel.org/appl/gitroot/citadel
[citadel.git]
/
citadel
/
modules
/
fulltext
/
serv_fulltext.c
diff --git
a/citadel/modules/fulltext/serv_fulltext.c
b/citadel/modules/fulltext/serv_fulltext.c
index 6288bfc9ab99adb0a240c99b739aab54da32622e..3709ef6319398c3515143af9871a7e473e9fcdfc 100644
(file)
--- a/
citadel/modules/fulltext/serv_fulltext.c
+++ b/
citadel/modules/fulltext/serv_fulltext.c
@@
-1,6
+1,6
@@
/*
* This module handles fulltext indexing of the message base.
/*
* This module handles fulltext indexing of the message base.
- * Copyright (c) 2005-201
1
by the citadel.org team
+ * Copyright (c) 2005-201
5
by the citadel.org team
*
* This program is open source software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
*
* This program is open source software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
@@
-120,7
+120,7
@@
void ft_index_message(long msgnum, int op) {
int tok;
struct CtdlMessage *msg = NULL;
int tok;
struct CtdlMessage *msg = NULL;
- msg = CtdlFetchMessage(msgnum, 1);
+ msg = CtdlFetchMessage(msgnum, 1
, 1
);
if (msg == NULL) {
syslog(LOG_ERR, "ft_index_message() could not load msg %ld", msgnum);
return;
if (msg == NULL) {
syslog(LOG_ERR, "ft_index_message() could not load msg %ld", msgnum);
return;
@@
-210,7
+210,7
@@
void ft_index_message(long msgnum, int op) {
*/
void ft_index_msg(long msgnum, void *userdata) {
*/
void ft_index_msg(long msgnum, void *userdata) {
- if ((msgnum > C
itControl.MMfulltext
) && (msgnum <= ft_newhighest)) {
+ if ((msgnum > C
tdlGetConfigLong("MMfulltext")
) && (msgnum <= ft_newhighest)) {
++ft_num_msgs;
if (ft_num_msgs > ft_num_alloc) {
ft_num_alloc += 1024;
++ft_num_msgs;
if (ft_num_msgs > ft_num_alloc) {
ft_num_alloc += 1024;
@@
-251,7
+251,7
@@
void do_fulltext_indexing(void) {
/*
* Don't do this if the site doesn't have it enabled.
*/
/*
* Don't do this if the site doesn't have it enabled.
*/
- if (!
config.c_enable_fulltext
) {
+ if (!
CtdlGetConfigInt("c_enable_fulltext")
) {
return;
}
return;
}
@@
-268,7
+268,10
@@
void do_fulltext_indexing(void) {
* Check to see whether the fulltext index is up to date; if there
* are no messages to index, don't waste any more time trying.
*/
* Check to see whether the fulltext index is up to date; if there
* are no messages to index, don't waste any more time trying.
*/
- if ((CitControl.MMfulltext >= CitControl.MMhighest) && (CitControl.fulltext_wordbreaker == FT_WORDBREAKER_ID)) {
+ if (
+ (CtdlGetConfigLong("MMfulltext") >= CtdlGetConfigLong("MMhighest"))
+ && (CtdlGetConfigInt("MM_fulltext_wordbreaker") == FT_WORDBREAKER_ID)
+ ) {
return; /* nothing to do! */
}
return; /* nothing to do! */
}
@@
-280,21
+283,20
@@
void do_fulltext_indexing(void) {
* over.
*/
begin_critical_section(S_CONTROL);
* over.
*/
begin_critical_section(S_CONTROL);
- if (C
itControl.fulltext_wordbreaker
!= FT_WORDBREAKER_ID) {
+ if (C
tdlGetConfigInt("MM_fulltext_wordbreaker")
!= FT_WORDBREAKER_ID) {
syslog(LOG_DEBUG, "wb ver on disk = %d, code ver = %d",
syslog(LOG_DEBUG, "wb ver on disk = %d, code ver = %d",
- C
itControl.fulltext_wordbreaker
, FT_WORDBREAKER_ID
+ C
tdlGetConfigInt("MM_fulltext_wordbreaker")
, FT_WORDBREAKER_ID
);
syslog(LOG_INFO, "(re)initializing full text index");
cdb_trunc(CDB_FULLTEXT);
);
syslog(LOG_INFO, "(re)initializing full text index");
cdb_trunc(CDB_FULLTEXT);
- CitControl.MMfulltext = 0L;
- put_control();
+ CtdlSetConfigLong("MMfulltext", 0);
}
end_critical_section(S_CONTROL);
/*
* Now go through each room and find messages to index.
*/
}
end_critical_section(S_CONTROL);
/*
* Now go through each room and find messages to index.
*/
- ft_newhighest = C
itControl.MMhighest
;
+ ft_newhighest = C
tdlGetConfigLong("MMhighest")
;
CtdlForEachRoom(ft_index_room, NULL); /* load all msg pointers */
if (ft_num_msgs > 0) {
CtdlForEachRoom(ft_index_room, NULL); /* load all msg pointers */
if (ft_num_msgs > 0) {
@@
-353,9
+355,8
@@
void do_fulltext_indexing(void) {
/* Save our place so we don't have to do this again */
ft_flush_cache();
begin_critical_section(S_CONTROL);
/* Save our place so we don't have to do this again */
ft_flush_cache();
begin_critical_section(S_CONTROL);
- CitControl.MMfulltext = ft_newhighest;
- CitControl.fulltext_wordbreaker = FT_WORDBREAKER_ID;
- put_control();
+ CtdlSetConfigLong("MMfulltext", ft_newhighest);
+ CtdlSetConfigInt("MM_fulltext_wordbreaker", FT_WORDBREAKER_ID);
end_critical_section(S_CONTROL);
last_index = time(NULL);
end_critical_section(S_CONTROL);
last_index = time(NULL);
@@
-455,7
+456,7
@@
void cmd_srch(char *argbuf) {
if (CtdlAccessCheck(ac_logged_in)) return;
if (CtdlAccessCheck(ac_logged_in)) return;
- if (!
config.c_enable_fulltext
) {
+ if (!
CtdlGetConfigInt("c_enable_fulltext")
) {
cprintf("%d Full text index is not enabled on this server.\n",
ERROR + CMD_NOT_SUPPORTED);
return;
cprintf("%d Full text index is not enabled on this server.\n",
ERROR + CMD_NOT_SUPPORTED);
return;
@@
-489,7
+490,7
@@
void ft_delete_remove(char *room, long msgnum)
if (room) return;
/* Remove from fulltext index */
if (room) return;
/* Remove from fulltext index */
- if (
config.c_enable_fulltext
) {
+ if (
CtdlGetConfigInt("c_enable_fulltext")
) {
ft_index_message(msgnum, 0);
}
}
ft_index_message(msgnum, 0);
}
}