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_spans_FirstSpanQuery_
8
#define _lucene_search_spans_FirstSpanQuery_
10
CL_CLASS_DEF(index, IndexReader);
11
#include "SpanQuery.h"
13
CL_NS_DEF2( search, spans )
15
/** Matches spans near the beginning of a field. */
16
class CLUCENE_EXPORT SpanFirstQuery : public SpanQuery
19
class SpanFirstQuerySpans;
27
SpanFirstQuery( const SpanFirstQuery& clone );
30
/** Construct a SpanFirstQuery matching spans in <code>match</code> whose end
31
* position is less than or equal to <code>end</code>. */
32
SpanFirstQuery( SpanQuery * match, int32_t end, bool bDeleteQuery );
33
virtual ~SpanFirstQuery();
35
CL_NS(search)::Query * clone() const;
37
static const char * getClassName();
38
const char * getObjectName() const;
40
/** Return the SpanQuery whose matches are filtered. */
41
SpanQuery * getMatch() const;
43
/** Return the maximum end position permitted in a match. */
44
int32_t getEnd() const;
46
const TCHAR * getField() const;
48
/** Returns a collection of all terms matched by this query.
49
* @deprecated use extractTerms instead
50
* @see #extractTerms(Set)
52
// public Collection getTerms() { return match.getTerms(); }
53
void extractTerms( CL_NS(search)::TermSet * terms ) const;
55
CL_NS(search)::Query * rewrite( CL_NS(index)::IndexReader * reader );
57
using Query::toString;
58
TCHAR* toString( const TCHAR* field ) const;
59
bool equals( Query* other ) const;
60
size_t hashCode() const;
62
Spans * getSpans( CL_NS(index)::IndexReader * reader );
66
#endif // _lucene_search_spans_FirstSpanQuery_