/*------------------------------------------------------------------------------
* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team
*
* Distributable under the terms of either the Apache License (Version 2.0) or
* the GNU Lesser General Public License, as specified in the COPYING file.
------------------------------------------------------------------------------*/
#ifndef _lucene_search_RangeQuery_
#define _lucene_search_RangeQuery_
//#include "SearchHeader.h"
//#include "Scorer.h"
//#include "TermQuery.h"
#include "Query.h"
CL_CLASS_DEF(index,Term)
//#include "CLucene/index/Terms.h"
CL_CLASS_DEF(util,StringBuffer)
CL_NS_DEF(search)
/**
* A Query that matches documents within an exclusive range. A RangeQuery
* is built by QueryParser for input like [010 TO 120] but only if the QueryParser has
* the useOldRangeQuery property set to true. The QueryParser default behaviour is to use
* the newer ConstantScoreRangeQuery class. This is generally preferable because:
*
lowerTerm but less than upperTerm.
* There must be at least one term and either term may be null,
* in which case there is no bound on that side, but if there are
* two terms, both terms must be for the same field.
*/
RangeQuery(CL_NS(index)::Term* LowerTerm, CL_NS(index)::Term* UpperTerm, const bool Inclusive);
~RangeQuery();
const char* getObjectName() const;
static const char* getClassName();
/**
* FIXME: Describe rewrite method here.
*
* @param reader an IndexReader value
* @return a Query value
* @exception IOException if an error occurs
*/
Query* rewrite(CL_NS(index)::IndexReader* reader);
Query* combine(CL_NS(util)::ArrayBasetrue if the range query is inclusive */
const TCHAR* getField() const;
size_t hashCode() const;
};
CL_NS_END
#endif