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 
00030 // Forward declaration.
00031 class Stats;
00032 
00033 class MultiMatch
00034 {
00035     private:
00037         std::vector<Xapian::Internal::RefCntPtr<SubMatch> > leaves;
00038 
00039         const Xapian::Database db;
00040 
00041         const Xapian::Query::Internal *query;
00042 
00043         Xapian::valueno collapse_key;
00044 
00045         int percent_cutoff;
00046 
00047         Xapian::weight weight_cutoff;
00048 
00049         Xapian::Enquire::docid_order order;
00050 
00051         Xapian::valueno sort_key;
00052 
00053         Xapian::Enquire::Internal::sort_setting sort_by;
00054 
00055         bool sort_value_forward;
00056 
00058         Xapian::ErrorHandler * errorhandler;
00059 
00061         const Xapian::Weight * weight;
00062 
00066         bool recalculate_w_max;
00067 
00069         vector<bool> is_remote;
00070 
00072         string get_collapse_key(PostList *pl,
00073                                 Xapian::docid did, Xapian::valueno keyno,
00074                                 Xapian::Internal::RefCntPtr<Xapian::Document::Internal> &doc);
00075 
00080         Xapian::weight getorrecalc_maxweight(PostList *pl);
00081 
00083         MultiMatch(const MultiMatch &);
00084 
00086         void operator=(const MultiMatch &);
00087 
00088     public:
00101         MultiMatch(const Xapian::Database &db_,
00102                    const Xapian::Query::Internal * query,
00103                    Xapian::termcount qlen,
00104                    const Xapian::RSet * omrset,
00105                    Xapian::valueno collapse_key_,
00106                    int percent_cutoff_,
00107                    Xapian::weight weight_cutoff_,
00108                    Xapian::Enquire::docid_order order_,
00109                    Xapian::valueno sort_key_,
00110                    Xapian::Enquire::Internal::sort_setting sort_by_,
00111                    bool sort_value_forward_,
00112                    Xapian::ErrorHandler * errorhandler,
00113                    Stats & stats,
00114                    const Xapian::Weight *wtscheme,
00115                    bool have_sorter, bool have_mdecider);
00116 
00121         void get_mset(Xapian::doccount first,
00122                       Xapian::doccount maxitems,
00123                       Xapian::doccount check_at_least,
00124                       Xapian::MSet & mset,
00125                       const Stats & stats,
00126                       const Xapian::MatchDecider * mdecider,
00127                       const Xapian::MatchDecider * matchspy,
00128                       const Xapian::Sorter * sorter);
00129 
00133         void recalc_maxweight();
00134 };
00135 
00136 #endif /* OM_HGUARD_MULTIMATCH_H */

Documentation for Xapian (version 1.0.20).
Generated on 28 Apr 2010 by Doxygen 1.5.2.