~ubuntu-branches/ubuntu/quantal/recoll/quantal

« back to all changes in this revision

Viewing changes to index/indexer.h

  • Committer: Package Import Robot
  • Author(s): Kartik Mistry
  • Date: 2012-03-27 12:15:51 UTC
  • mfrom: (1.3.8)
  • Revision ID: package-import@ubuntu.com-20120327121551-nmntidzpehudushy
Tags: 1.17.1-1
* New upstream release.
* Enable Python module resulting into new binary: python-recoll.
* debian/control:
  + Updated Build-Deps: libqtwebkit-dev, python-all-dev.
  + Added python-recoll binary.
  + Updated Standards-Version to 3.9.3
* debian/rules:
  + Build Python module by default.
* debian/recoll.menu, debian/python-recoll.install, debian/recoll.install:
  + Changes for new binary package.
* debian/copyright:
  + Updated to copyright-format 1.0
  + Updated upstream and Debian copyright.
  + Fixed unicode.org/copyright.html URL.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
#include <string>
21
21
#include <list>
22
22
#include <map>
 
23
#include <vector>
23
24
 
24
25
#ifndef NO_NAMESPACES
25
26
using std::string;
26
27
using std::list;
27
28
using std::map;
 
29
using std::vector;
28
30
#endif
29
31
 
30
32
#include "rclconfig.h"
31
33
#include "rcldb.h"
 
34
#include "rcldoc.h"
32
35
 
33
36
class FsIndexer;
34
37
class BeagleQueueIndexer;
35
38
 
36
39
class DbIxStatus {
37
40
 public:
38
 
    enum Phase {DBIXS_FILES, DBIXS_PURGE, DBIXS_STEMDB, DBIXS_CLOSING};
 
41
    enum Phase {DBIXS_NONE,
 
42
                DBIXS_FILES, DBIXS_PURGE, DBIXS_STEMDB, DBIXS_CLOSING, 
 
43
                DBIXS_MONITOR,
 
44
                DBIXS_DONE};
39
45
    Phase phase;
40
46
    string fn;   // Last file processed
41
 
    int docsdone;  // Documents processed
 
47
    int docsdone;  // Documents actually updated
 
48
    int filesdone; // Files tested (updated or not)
42
49
    int dbtotdocs;  // Doc count in index at start
43
 
    void reset() {phase = DBIXS_FILES;fn.erase();docsdone=dbtotdocs=0;}
 
50
    void reset() 
 
51
    {
 
52
        phase = DBIXS_FILES;
 
53
        fn.erase();
 
54
        docsdone = filesdone = dbtotdocs = 0;
 
55
    }
44
56
    DbIxStatus() {reset();}
45
57
};
46
58
 
50
62
 public:
51
63
    DbIxStatus status;
52
64
    virtual ~DbIxStatusUpdater(){}
53
 
    virtual bool update() = 0;
 
65
 
 
66
    // Convenience: change phase/fn and update
54
67
    virtual bool update(DbIxStatus::Phase phase, const string& fn)
55
68
    {
56
69
        status.phase = phase;
57
70
        status.fn = fn;
58
71
        return update();
59
72
    }
 
73
 
 
74
    // To be implemented by user for sending info somewhere
 
75
    virtual bool update() = 0;
60
76
};
61
77
 
62
78
/**
94
110
    static list<string> getStemmerNames();
95
111
 
96
112
    /** Index a list of files. No db cleaning or stemdb updating */
97
 
    bool indexFiles(std::list<string> &files, IxFlag f = IxFNone);
 
113
    bool indexFiles(list<string> &files, IxFlag f = IxFNone);
98
114
 
 
115
    /** Update index for list of documents given as list of docs (out of query)
 
116
     */
 
117
    bool updateDocs(vector<Rcl::Doc> &docs, IxFlag f = IxFNone);
 
118
    static bool docsToPaths(vector<Rcl::Doc> &docs, vector<string> &paths);
99
119
    /** Purge a list of files. */
100
 
    bool purgeFiles(std::list<string> &files);
 
120
    bool purgeFiles(list<string> &files);
101
121
 
102
122
 private:
103
123
    RclConfig *m_config;