00001 /* mergepostlist.h: merge postlists from different databases 00002 * 00003 * Copyright 1999,2000,2001 BrightStation PLC 00004 * Copyright 2002 Ananova Ltd 00005 * Copyright 2002,2003,2004,2005,2009 Olly Betts 00006 * Copyright 2007 Lemur Consulting Ltd 00007 * 00008 * This program is free software; you can redistribute it and/or 00009 * modify it under the terms of the GNU General Public License as 00010 * published by the Free Software Foundation; either version 2 of the 00011 * License, or (at your option) any later version. 00012 * 00013 * This program is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 * GNU General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU General Public License 00019 * along with this program; if not, write to the Free Software 00020 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 00021 * USA 00022 */ 00023 00024 #ifndef OM_HGUARD_MERGEPOSTLIST_H 00025 #define OM_HGUARD_MERGEPOSTLIST_H 00026 00027 #include "postlist.h" 00028 00029 class MultiMatch; 00030 class ValueStreamDocument; 00031 00034 class MergePostList : public PostList { 00035 private: 00036 // Prevent copying 00037 MergePostList(const MergePostList &); 00038 MergePostList & operator=(const MergePostList &); 00039 00040 Xapian::weight w_max; 00041 00042 vector<PostList *> plists; 00043 00044 int current; 00045 00051 MultiMatch *matcher; 00052 00059 ValueStreamDocument & vsdoc; 00060 00061 Xapian::ErrorHandler * errorhandler; 00062 public: 00063 Xapian::termcount get_wdf() const; 00064 Xapian::doccount get_termfreq_max() const; 00065 Xapian::doccount get_termfreq_min() const; 00066 Xapian::doccount get_termfreq_est() const; 00067 00068 Xapian::docid get_docid() const; 00069 Xapian::weight get_weight() const; 00070 const string * get_collapse_key() const; 00071 00072 Xapian::weight get_maxweight() const; 00073 00074 Xapian::weight recalc_maxweight(); 00075 00076 PostList *next(Xapian::weight w_min); 00077 PostList *skip_to(Xapian::docid did, Xapian::weight w_min); 00078 bool at_end() const; 00079 00080 string get_description() const; 00081 00085 virtual Xapian::termcount get_doclength() const; 00086 00087 Xapian::termcount count_matching_subqs() const; 00088 00089 MergePostList(const std::vector<PostList *> & plists_, 00090 MultiMatch *matcher_, 00091 ValueStreamDocument & vsdoc_, 00092 Xapian::ErrorHandler * errorhandler_) 00093 : plists(plists_), current(-1), matcher(matcher_), vsdoc(vsdoc_), 00094 errorhandler(errorhandler_) { } 00095 00096 ~MergePostList(); 00097 }; 00098 00099 #endif /* OM_HGUARD_MERGEPOSTLIST_H */