Switch to unified view

a/src/index/indexer.h b/src/index/indexer.h
...
...
22
#include <list>
22
#include <list>
23
#include <map>
23
#include <map>
24
#include <vector>
24
#include <vector>
25
#include <mutex>
25
#include <mutex>
26
26
27
using std::string;
28
using std::list;
29
using std::map;
30
using std::vector;
31
32
#include "rcldb.h"
27
#include "rcldb.h"
33
#include "rcldoc.h"
28
#include "rcldoc.h"
29
#include "idxstatus.h"
34
30
35
class FsIndexer;
31
class FsIndexer;
36
class BeagleQueueIndexer;
32
class BeagleQueueIndexer;
37
38
class DbIxStatus {
39
 public:
40
    enum Phase {DBIXS_NONE,
41
      DBIXS_FILES, DBIXS_PURGE, DBIXS_STEMDB, DBIXS_CLOSING, 
42
      DBIXS_MONITOR,
43
      DBIXS_DONE};
44
    Phase phase;
45
    string fn;   // Last file processed
46
    int docsdone;  // Documents actually updated
47
    int filesdone; // Files tested (updated or not)
48
    int fileerrors; // Failed files (e.g.: missing input handler).
49
    int dbtotdocs;  // Doc count in index at start
50
    // Total files in index.This is actually difficult to compute from
51
    // the index so it's preserved from last indexing
52
    int totfiles;
53
    
54
    void reset() {
55
  phase = DBIXS_FILES;
56
  fn.erase();
57
  docsdone = filesdone = fileerrors = dbtotdocs = totfiles = 0;
58
    }
59
    DbIxStatus() {reset();}
60
};
61
33
62
/** Callback to say what we're doing. If the update func returns false, we
34
/** Callback to say what we're doing. If the update func returns false, we
63
 * stop as soon as possible without corrupting state */
35
 * stop as soon as possible without corrupting state */
64
class DbIxStatusUpdater {
36
class DbIxStatusUpdater {
65
 public:
37
 public:
...
...
128
100
129
    /** List possible stemmer names */
101
    /** List possible stemmer names */
130
    static vector<string> getStemmerNames();
102
    static vector<string> getStemmerNames();
131
103
132
    /** Index a list of files. No db cleaning or stemdb updating */
104
    /** Index a list of files. No db cleaning or stemdb updating */
133
    bool indexFiles(list<string> &files, int f = IxFNone);
105
    bool indexFiles(std::list<std::string> &files, int f = IxFNone);
134
106
135
    /** Update index for list of documents given as list of docs (out of query)
107
    /** Update index for list of documents given as list of docs (out of query)
136
     */
108
     */
137
    bool updateDocs(vector<Rcl::Doc> &docs, IxFlag f = IxFNone);
109
    bool updateDocs(vector<Rcl::Doc> &docs, IxFlag f = IxFNone);
138
110
139
    /** Purge a list of files. */
111
    /** Purge a list of files. */
140
    bool purgeFiles(list<string> &files, int f = IxFNone);
112
    bool purgeFiles(std::list<std::string> &files, int f = IxFNone);
141
113
142
    /** Set in place reset mode */
114
    /** Set in place reset mode */
143
    void setInPlaceReset() {m_db.setInPlaceReset();}
115
    void setInPlaceReset() {m_db.setInPlaceReset();}
144
 private:
116
 private:
145
    RclConfig *m_config;
117
    RclConfig *m_config;