1
/*------------------------------------------------------------------------------
2
* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team
4
* Distributable under the terms of either the Apache License (Version 2.0) or
5
* the GNU Lesser General Public License, as specified in the COPYING file.
6
------------------------------------------------------------------------------*/
7
#ifndef _lucene_search_WildcardQuery_
8
#define _lucene_search_WildcardQuery_
9
#if defined(_LUCENE_PRAGMA_ONCE)
13
#include "CLucene/index/IndexReader.h"
14
#include "CLucene/index/Term.h"
15
#include "MultiTermQuery.h"
16
#include "WildcardTermEnum.h"
20
/** Implements the wildcard search query. Supported wildcards are <code>*</code>, which
21
* matches any character sequence (including the empty one), and <code>?</code>,
22
* which matches any single character. Note this query can be slow, as it
23
* needs to iterate over all terms. In order to prevent extremely slow WildcardQueries,
24
* a Wildcard term must not start with one of the wildcards <code>*</code> or
27
* @see WildcardTermEnum
29
class WildcardQuery: public MultiTermQuery {
31
FilteredTermEnum* getEnum(CL_NS(index)::IndexReader* reader);
32
WildcardQuery(const WildcardQuery& clone);
34
WildcardQuery(CL_NS(index)::Term* term);
37
//Returns the string "WildcardQuery"
38
const TCHAR* getQueryName() const;
39
static const TCHAR* getClassName();
41
size_t hashCode() const;
42
bool equals(Query* other) const;
48
class WildcardFilter: public Filter
51
CL_NS(index)::Term* term;
53
WildcardFilter( const WildcardFilter& copy );
56
WildcardFilter(CL_NS(index)::Term* term);
59
/** Returns a BitSet with true for documents which should be permitted in
60
search results, and false for those that should not. */
61
CL_NS(util)::BitSet* bits( CL_NS(index)::IndexReader* reader );
63
Filter* clone() const;