Switch to unified view

a/src/rcldb/rcldb.h b/src/rcldb/rcldb.h
...
...
226
    bool fieldToTraits(const string& fldname, const FieldTraits **ftpp,
226
    bool fieldToTraits(const string& fldname, const FieldTraits **ftpp,
227
                       bool isquery = false);
227
                       bool isquery = false);
228
228
229
    /* Update-related methods ******************************************/
229
    /* Update-related methods ******************************************/
230
230
231
    /** Test if the db entry for the given udi is up to date (by
231
    /** Test if the db entry for the given udi is up to date.
232
     *
232
     * comparing the input and stored sigs). This is used both when 
233
     * This is done by comparing the input and stored sigs. This is
233
     * indexing and querying (before opening a document using stale info),
234
     * used both when indexing and querying (before opening a document 
235
     * using stale info).
236
     *
234
     * **This assumes that the udi pertains to the main index (idxi==0).**
237
     * **This assumes that the udi pertains to the main index (idxi==0).**
235
     * Side-effect when the db is writeable: set the existence flag
236
     * for the file document and all subdocs if any (for later use by
237
     * 'purge()')
238
     */
238
     *
239
     * Side-effect when the db is writeable and the document up to
240
     * date: set the existence flag for the file document and all
241
     * subdocs if any (for later use by 'purge()')
242
     *
243
     * @param udi Unique Document Identifier (as chosen by indexer).
244
     * @param sig New signature (as computed by indexer).
245
     * @param xdocid[output] Non-zero if doc existed. Should be considered 
246
     *    as opaque, to be used for a possible later call to setExistingFlags()
247
     *    Note that if inplaceReset is set, the return value is non-zero but not
248
     *    an actual docid, it's only used as a flag in this case.
249
     * @param osig[output] old signature.
250
     */
239
    bool needUpdate(const string &udi, const string& sig, bool *existed=0);
251
    bool needUpdate(const string &udi, const string& sig, 
252
                    unsigned int *xdocid = 0, std::string *osig = 0);
253
254
    /** Set the existance flags for the document and its eventual subdocuments
255
     * 
256
     * This can be called by the indexer after needUpdate() has returned true,
257
     * if the indexer does not wish to actually re-index (e.g.: the doc is 
258
     * known to cause errors).
259
     */
260
    void setExistingFlags(const string& udi, unsigned int docid);
240
261
241
    /** Indicate if we are doing a systematic reindex. This complements
262
    /** Indicate if we are doing a systematic reindex. This complements
242
    needUpdate() return */
263
    needUpdate() return */
243
    bool inFullReset() {return o_inPlaceReset || m_mode == DbTrunc;}
264
    bool inFullReset() {return o_inPlaceReset || m_mode == DbTrunc;}
244
265
...
...
486
507
487
#ifdef IDX_THREADS
508
#ifdef IDX_THREADS
488
    friend void *DbUpdWorker(void*);
509
    friend void *DbUpdWorker(void*);
489
#endif // IDX_THREADS
510
#endif // IDX_THREADS
490
511
512
    // Internal form of setExistingFlags: no locking
513
    void i_setExistingFlags(const string& udi, unsigned int docid);
491
    // Internal form of close, can be called during destruction
514
    // Internal form of close, can be called during destruction
492
    bool i_close(bool final);
515
    bool i_close(bool final);
493
    // Reinitialize when adding/removing additional dbs
516
    // Reinitialize when adding/removing additional dbs
494
    bool adjustdbs(); 
517
    bool adjustdbs(); 
495
    bool idxTermMatch(int typ_sens, const string &lang, const string &term, 
518
    bool idxTermMatch(int typ_sens, const string &lang, const string &term,