xapian-core  1.4.25
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  Xapian::termcount wdf_upper_bound_)
51  : ChertPostList(this_db_, term_, true),
52  mods(mods_), it(mods.begin()), poslist(0)
53  {
54  ChertPostList::wdf_upper_bound = wdf_upper_bound_;
55  }
56 
58 
59  Xapian::doccount get_termfreq() const;
60 
61  Xapian::docid get_docid() const;
62 
63  Xapian::termcount get_doclength() const;
64 
65  Xapian::termcount get_unique_terms() const;
66 
67  Xapian::termcount get_wdf() const;
68 
69  PositionList *read_position_list();
70 
71  PositionList *open_position_list() const;
72 
73  PostList * next(double w_min);
74 
75  PostList * skip_to(Xapian::docid desired_did, double w_min);
76 
77  bool at_end() const;
78 
79  std::string get_description() const;
80 };
81 
82 #endif // XAPIAN_INCLUDED_CHERT_MODIFIEDPOSTLIST_H
Abstract base class for postlists.
Definition: postlist.h:37
map< Xapian::docid, pair< char, Xapian::termcount > > mods
Modifications to apply to the ChertPostList.
Xapian::termcount wdf_upper_bound
Upper bound on wdf for this postlist.
#define true
Definition: header.h:8
STL namespace.
ChertModifiedPostList(Xapian::Internal::intrusive_ptr< const ChertDatabase > this_db_, const string &term_, const map< Xapian::docid, pair< char, Xapian::termcount > > &mods_, Xapian::termcount wdf_upper_bound_)
Constructor.
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