xapian-core  1.4.21
chert_modifiedpostlist.h
Go to the documentation of this file.
1 
4 /* Copyright (C) 2006,2007,2008,2009,2011,2015 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_MODIFIEDPOSTLIST_H
22 #define XAPIAN_INCLUDED_CHERT_MODIFIEDPOSTLIST_H
23 
24 #include <map>
25 #include <string>
26 
27 using namespace std;
28 
29 #include "chert_database.h"
30 #include "chert_postlist.h"
31 
34 
35  map<Xapian::docid, pair<char, Xapian::termcount> > mods;
36  map<Xapian::docid, pair<char, Xapian::termcount> >::const_iterator it;
38 
41 
43  void skip_deletes(double w_min);
44 
45  public:
48  const string & term_,
49  const map<Xapian::docid, pair<char, Xapian::termcount> > & mods_)
50  : ChertPostList(this_db_, term_, true),
51  mods(mods_), it(mods.begin()), poslist(0)
52  { }
53 
55 
56  Xapian::doccount get_termfreq() const;
57 
58  Xapian::docid get_docid() const;
59 
60  Xapian::termcount get_doclength() const;
61 
62  Xapian::termcount get_unique_terms() const;
63 
64  Xapian::termcount get_wdf() const;
65 
66  PositionList *read_position_list();
67 
68  PositionList *open_position_list() const;
69 
70  PostList * next(double w_min);
71 
72  PostList * skip_to(Xapian::docid desired_did, double w_min);
73 
74  bool at_end() const;
75 
76  std::string get_description() const;
77 };
78 
79 #endif // XAPIAN_INCLUDED_CHERT_MODIFIEDPOSTLIST_H
ChertModifiedPostList(Xapian::Internal::intrusive_ptr< const ChertDatabase > this_db_, const string &term_, const map< Xapian::docid, pair< char, Xapian::termcount > > &mods_)
Constructor.
Abstract base class for postlists.
Definition: postlist.h:37
map< Xapian::docid, pair< char, Xapian::termcount > > mods
Modifications to apply to the ChertPostList.
#define true
Definition: header.h:8
STL namespace.
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
Definition: types.h:72
PositionList * poslist
Pointer to PositionList returned from read_position_list to be deleted.
C++ class definition for chert database.
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
Definition: types.h:38
Postlists in chert databases.
map< Xapian::docid, pair< char, Xapian::termcount > >::const_iterator it
Modifications to apply to the ChertPostList.
A postlist in a chert database.
unsigned XAPIAN_DOCID_BASE_TYPE docid
A unique identifier for a document.
Definition: types.h:52
Abstract base class for iterating term positions in a document.
Definition: positionlist.h:31