CLucene - a full-featured, c++ search engine
API Documentation
00001 /*------------------------------------------------------------------------------ 00002 * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team 00003 * 00004 * Distributable under the terms of either the Apache License (Version 2.0) or 00005 * the GNU Lesser General Public License, as specified in the COPYING file. 00006 ------------------------------------------------------------------------------*/ 00007 #ifndef _lucene_search_RangeQuery_ 00008 #define _lucene_search_RangeQuery_ 00009 00010 //#include "SearchHeader.h" 00011 //#include "Scorer.h" 00012 //#include "TermQuery.h" 00013 #include "Query.h" 00014 00015 CL_CLASS_DEF(index,Term) 00016 //#include "CLucene/index/Terms.h" 00017 00018 CL_CLASS_DEF(util,StringBuffer) 00019 00020 00021 CL_NS_DEF(search) 00028 class CLUCENE_EXPORT RangeQuery: public Query 00029 { 00030 private: 00031 CL_NS(index)::Term* lowerTerm; 00032 CL_NS(index)::Term* upperTerm; 00033 bool inclusive; 00034 protected: 00035 RangeQuery(const RangeQuery& clone); 00036 00037 public: 00038 // Constructs a query selecting all terms greater than 00039 // <code>lowerTerm</code> but less than <code>upperTerm</code>. 00040 // There must be at least one term and either term may be NULL-- 00041 // in which case there is no bound on that side, but if there are 00042 // two term, both terms <b>must</b> be for the same field. 00043 RangeQuery(CL_NS(index)::Term* LowerTerm, CL_NS(index)::Term* UpperTerm, const bool Inclusive); 00044 ~RangeQuery(); 00045 00046 const TCHAR* getQueryName() const; 00047 static const TCHAR* getClassName(); 00048 00049 Query* rewrite(CL_NS(index)::IndexReader* reader); 00050 00051 Query* combine(Query** queries); 00052 00053 // Prints a user-readable version of this query. 00054 TCHAR* toString(const TCHAR* field) const; 00055 00056 Query* clone() const; 00057 00058 bool equals(Query * other) const; 00059 00060 CL_NS(index)::Term* getLowerTerm(bool pointer=true) const; 00061 CL_NS(index)::Term* getUpperTerm(bool pointer=true) const; 00062 bool isInclusive() const; 00063 const TCHAR* getField() const; 00064 00065 size_t hashCode() const; 00066 }; 00067 00068 CL_NS_END 00069 #endif