00001 /* andnotpostlist.h: Return items which are in A, unless they're in B 00002 * 00003 * Copyright 1999,2000,2001 BrightStation PLC 00004 * Copyright 2002 Ananova Ltd 00005 * Copyright 2003,2004,2009 Olly Betts 00006 * Copyright 2009 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_ANDNOTPOSTLIST_H 00025 #define OM_HGUARD_ANDNOTPOSTLIST_H 00026 00027 #include "branchpostlist.h" 00028 00034 class AndNotPostList : public BranchPostList { 00035 private: 00036 Xapian::docid lhead, rhead; 00037 00039 Xapian::doccount dbsize; 00040 00041 PostList *advance_to_next_match(Xapian::weight w_min, PostList *ret); 00042 public: 00043 Xapian::doccount get_termfreq_max() const; 00044 Xapian::doccount get_termfreq_min() const; 00045 Xapian::doccount get_termfreq_est() const; 00046 TermFreqs get_termfreq_est_using_stats( 00047 const Xapian::Weight::Internal & stats) const; 00048 00049 Xapian::docid get_docid() const; 00050 Xapian::weight get_weight() const; 00051 Xapian::weight get_maxweight() const; 00052 00053 Xapian::weight recalc_maxweight(); 00054 00055 PostList *next(Xapian::weight w_min); 00056 PostList *skip_to(Xapian::docid did, Xapian::weight w_min); 00057 bool at_end() const; 00058 00059 std::string get_description() const; 00060 00064 virtual Xapian::termcount get_doclength() const; 00065 00066 AndNotPostList(PostList *left, 00067 PostList *right, 00068 MultiMatch *matcher_, 00069 Xapian::doccount dbsize_); 00070 00071 PostList *sync_and_skip_to(Xapian::docid id, 00072 Xapian::weight w_min, 00073 Xapian::docid lh, 00074 Xapian::docid rh); 00075 00079 Xapian::termcount get_wdf() const; 00080 00081 Xapian::termcount count_matching_subqs() const; 00082 }; 00083 00084 #endif /* OM_HGUARD_ANDNOTPOSTLIST_H */