- // Now go through each room and find messages to index.
- ft_newhighest = CtdlGetConfigLong("MMhighest");
- CtdlForEachRoom(ft_index_room, NULL); // load all msg pointers
-
- if (ft_num_msgs > 0) {
- qsort(ft_newmsgs, ft_num_msgs, sizeof(long), longcmp);
- for (i=0; i<(ft_num_msgs-1); ++i) { // purge dups
- if (ft_newmsgs[i] == ft_newmsgs[i+1]) {
- memmove(&ft_newmsgs[i], &ft_newmsgs[i+1], ((ft_num_msgs - i - 1)*sizeof(long)));
- --ft_num_msgs;
- --i;
- }
- }
-
- // Here it is ... do each message!
- for (i=0; i<ft_num_msgs; ++i) {
- if (time(NULL) != last_progress) {
- syslog(LOG_DEBUG,
- "fulltext: indexed %d of %d messages (%d%%)", i, ft_num_msgs, ((i*100) / ft_num_msgs));
- last_progress = time(NULL);
- }
- ft_index_message(ft_newmsgs[i], 1);
+ highest_msg_already_indexed = CtdlGetConfigLong("MMfulltext");
+ highest_msg_to_be_indexed = CtdlGetConfigLong("MMhighest");
+ messages_to_be_indexed = array_new(sizeof(long));