Create CDB_CONFIG database. Renamed some members of CitControl.
[citadel.git] / citadel / modules / fulltext / serv_fulltext.c
index 8e668778817a405208c55cc6ab3ffd7e34f217ad..7f5da0fe84d604863b3ba68567a1f4d73d7fd570 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * This module handles fulltext indexing of the message base.
- * Copyright (c) 2005-2011 by the citadel.org team
+ * Copyright (c) 2005-2015 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
@@ -126,9 +126,9 @@ void ft_index_message(long msgnum, int op) {
                return;
        }
 
-       if (msg->cm_fields['1'] != NULL) {
+       if (!CM_IsEmpty(msg, eSuppressIdx)) {
                syslog(LOG_DEBUG, "ft_index_message() excluded msg %ld", msgnum);
-               CtdlFreeMessage(msg);
+               CM_Free(msg);
                return;
        }
 
@@ -139,7 +139,7 @@ void ft_index_message(long msgnum, int op) {
         */
        CC->redirect_buffer = NewStrBufPlain(NULL, SIZ);
        CtdlOutputPreLoadedMsg(msg, MT_CITADEL, HEADERS_ALL, 0, 1, 0);
-       CtdlFreeMessage(msg);
+       CM_Free(msg);
        msgtext = CC->redirect_buffer;
        CC->redirect_buffer = NULL;
        if (msgtext != NULL) {
@@ -268,7 +268,7 @@ 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.
         */
-       if ((CitControl.MMfulltext >= CitControl.MMhighest) && (CitControl.fulltext_wordbreaker == FT_WORDBREAKER_ID)) {
+       if ((CitControl.MMfulltext >= CitControl.MMhighest) && (CitControl.MM_fulltext_wordbreaker == FT_WORDBREAKER_ID)) {
                return;         /* nothing to do! */
        }
        
@@ -280,9 +280,9 @@ void do_fulltext_indexing(void) {
         * over.
         */
        begin_critical_section(S_CONTROL);
-       if (CitControl.fulltext_wordbreaker != FT_WORDBREAKER_ID) {
+       if (CitControl.MM_fulltext_wordbreaker != FT_WORDBREAKER_ID) {
                syslog(LOG_DEBUG, "wb ver on disk = %d, code ver = %d",
-                       CitControl.fulltext_wordbreaker, FT_WORDBREAKER_ID
+                       CitControl.MM_fulltext_wordbreaker, FT_WORDBREAKER_ID
                );
                syslog(LOG_INFO, "(re)initializing full text index");
                cdb_trunc(CDB_FULLTEXT);
@@ -354,7 +354,7 @@ void do_fulltext_indexing(void) {
        ft_flush_cache();
        begin_critical_section(S_CONTROL);
        CitControl.MMfulltext = ft_newhighest;
-       CitControl.fulltext_wordbreaker = FT_WORDBREAKER_ID;
+       CitControl.MM_fulltext_wordbreaker = FT_WORDBREAKER_ID;
        put_control();
        end_critical_section(S_CONTROL);
        last_index = time(NULL);