xapian-core  1.4.26
chert_termlisttable.h
Go to the documentation of this file.
1 
4 /* Copyright (C) 2007,2008,2009 Olly Betts
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 #ifndef XAPIAN_INCLUDED_CHERT_TERMLISTTABLE_H
22 #define XAPIAN_INCLUDED_CHERT_TERMLISTTABLE_H
23 
24 #include <xapian/types.h>
25 
26 #include "chert_lazytable.h"
27 #include "pack.h"
28 
29 #include <string>
30 
31 namespace Xapian {
32 class Document;
33 }
34 
36  public:
37  static std::string make_key(Xapian::docid did) {
38  std::string key;
40  return key;
41  }
42 
51  ChertTermListTable(const std::string & dbdir, bool readonly)
52  : ChertLazyTable("termlist", dbdir + "/termlist.", readonly,
53  Z_DEFAULT_STRATEGY) { }
54 
63  void set_termlist(Xapian::docid did, const Xapian::Document & doc,
64  chert_doclen_t doclen);
65 
70  void delete_termlist(Xapian::docid did) { del(make_key(did)); }
71 
79  void create_and_open(unsigned int blocksize) {
80  ChertTable::create_and_open(blocksize);
81  }
82 };
83 
84 #endif // XAPIAN_INCLUDED_CHERT_TERMLISTTABLE_H
void delete_termlist(Xapian::docid did)
Delete the termlist data for document did.
The Xapian namespace contains public interfaces for the Xapian library.
Definition: compactor.cc:80
typedefs for Xapian
void create_and_open(unsigned int blocksize)
Create a new empty btree structure on disk and open it at the initial revision.
void create_and_open(unsigned int blocksize)
Non-lazy override of ChertLazyTable::create_and_open().
void C_pack_uint_preserving_sort(std::string &s, U value)
Append an encoded unsigned integer to a string, preserving the sort order.
Definition: pack.h:149
static std::string make_key(Xapian::docid did)
Subclass of ChertTable for deriving lazy tables from.
Pack types into strings and unpack them again.
unsigned XAPIAN_DOCID_BASE_TYPE docid
A unique identifier for a document.
Definition: types.h:52
unsigned int chert_doclen_t
An integer type for storing the length of a document - ie, the sum of the wdfs of the terms in the do...
Definition: chert_types.h:51
A handle representing a document in a Xapian database.
Definition: document.h:61
string make_key(Xapian::docid did)
Definition: chert_record.cc:35
ChertTermListTable(const std::string &dbdir, bool readonly)
Create a new ChertTermListTable object.