common/multimatch.h

Go to the documentation of this file.
00001 /* multimatch.h: class for performing a match
00002  *
00003  * Copyright 1999,2000,2001 BrightStation PLC
00004  * Copyright 2002,2003,2004,2005,2006,2007 Olly Betts
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License as
00008  * published by the Free Software Foundation; either version 2 of the
00009  * License, or (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301
00019  * USA
00020  */
00021 
00022 #ifndef OM_HGUARD_MULTIMATCH_H
00023 #define OM_HGUARD_MULTIMATCH_H
00024 
00025 #include "omqueryinternal.h"
00026 #include "submatch.h"
00027 
00028 #include <vector>
00029 #include <map>
00030 
00031 // Forward declaration.
00032 class Stats;
00033 
00034 class MultiMatch
00035 {
00036     private:
00038         std::vector<Xapian::Internal::RefCntPtr<SubMatch> > leaves;
00039 
00040         const Xapian::Database db;
00041 
00042         const Xapian::Query::Internal *query;
00043 
00044         Xapian::valueno collapse_key;
00045 
00046         int percent_cutoff;
00047 
00048         Xapian::weight weight_cutoff;
00049 
00050         Xapian::Enquire::docid_order order;
00051 
00052         Xapian::valueno sort_key;
00053 
00054         Xapian::Enquire::Internal::sort_setting sort_by;
00055 
00056         bool sort_value_forward;
00057 
00058         const Xapian::Sorter * sorter;
00059 
00061         Xapian::ErrorHandler * errorhandler;
00062 
00064         const Xapian::Weight * weight;
00065 
00069         bool recalculate_w_max;
00070 
00072         vector<bool> is_remote;
00073 
00075         string get_collapse_key(PostList *pl,
00076                                 Xapian::docid did, Xapian::valueno keyno,
00077                                 Xapian::Internal::RefCntPtr<Xapian::Document::Internal> &doc);
00078 
00083         Xapian::weight getorrecalc_maxweight(PostList *pl);
00084 
00086         MultiMatch(const MultiMatch &);
00087 
00089         void operator=(const MultiMatch &);
00090 
00091     public:
00103         MultiMatch(const Xapian::Database &db_,
00104                    const Xapian::Query::Internal * query,
00105                    Xapian::termcount qlen,
00106                    const Xapian::RSet * omrset,
00107                    Xapian::valueno collapse_key_,
00108                    int percent_cutoff_,
00109                    Xapian::weight weight_cutoff_,
00110                    Xapian::Enquire::docid_order order_,
00111                    Xapian::valueno sort_key_,
00112                    Xapian::Enquire::Internal::sort_setting sort_by_,
00113                    bool sort_value_forward_,
00114                    const Xapian::Sorter * sorter_,
00115                    Xapian::ErrorHandler * errorhandler,
00116                    Stats & stats,
00117                    const Xapian::Weight *wtscheme);
00118 
00119         void get_mset(Xapian::doccount first,
00120                       Xapian::doccount maxitems,
00121                       Xapian::doccount check_at_least,
00122                       Xapian::MSet & mset,
00123                       const Stats & stats,
00124                       const Xapian::MatchDecider * mdecider,
00125                       const Xapian::MatchDecider * matchspy);
00126 
00130         void recalc_maxweight();
00131 };
00132 
00133 #endif /* OM_HGUARD_MULTIMATCH_H */

Documentation for Xapian (version 1.0.10).
Generated on 24 Dec 2008 by Doxygen 1.5.2.