Lucene++ - a full-featured, c++ search engine
API Documentation


SpanFirstQuery.h
Go to the documentation of this file.
1 // Copyright (c) 2009-2014 Alan Wright. All rights reserved.
3 // Distributable under the terms of either the Apache License (Version 2.0)
4 // or the GNU Lesser General Public License.
6 
7 #ifndef SPANFIRSTQUERY_H
8 #define SPANFIRSTQUERY_H
9 
10 #include "SpanQuery.h"
11 #include "Spans.h"
12 
13 namespace Lucene {
14 
16 class LPPAPI SpanFirstQuery : public SpanQuery {
17 public:
19  SpanFirstQuery(const SpanQueryPtr& match, int32_t end);
20  virtual ~SpanFirstQuery();
21 
23 
24 protected:
26  int32_t end;
27 
28 public:
29  using SpanQuery::toString;
30 
33 
35  int32_t getEnd();
36 
37  virtual String getField();
38  virtual String toString(const String& field);
40  virtual void extractTerms(SetTerm terms);
41  virtual SpansPtr getSpans(const IndexReaderPtr& reader);
42  virtual QueryPtr rewrite(const IndexReaderPtr& reader);
43 
44  virtual bool equals(const LuceneObjectPtr& other);
45  virtual int32_t hashCode();
46 
47  friend class FirstSpans;
48 };
49 
50 }
51 
52 #endif
Lucene::SpanQueryPtr
boost::shared_ptr< SpanQuery > SpanQueryPtr
Definition: LuceneTypes.h:450
Lucene::SpanQuery
Base class for span-based queries.
Definition: SpanQuery.h:15
LUCENE_CLASS
#define LUCENE_CLASS(Name)
Definition: LuceneObject.h:24
Lucene::SpanFirstQuery::extractTerms
virtual void extractTerms(SetTerm terms)
Adds all terms occurring in this query to the terms set. Only works if this query is in its rewritten...
Lucene::LuceneObjectPtr
boost::shared_ptr< LuceneObject > LuceneObjectPtr
Definition: LuceneTypes.h:539
Lucene::SpanFirstQuery::SpanFirstQuery
SpanFirstQuery(const SpanQueryPtr &match, int32_t end)
Construct a SpanFirstQuery matching spans in match whose end position is less than or equal to end.
Lucene::QueryPtr
boost::shared_ptr< Query > QueryPtr
Definition: LuceneTypes.h:420
Lucene::SpanFirstQuery::hashCode
virtual int32_t hashCode()
Return hash code for this object.
Lucene::SpanFirstQuery::match
SpanQueryPtr match
Definition: SpanFirstQuery.h:22
Lucene::SpanFirstQuery::~SpanFirstQuery
virtual ~SpanFirstQuery()
Lucene::SpanFirstQuery::equals
virtual bool equals(const LuceneObjectPtr &other)
Return whether two objects are equal.
Lucene
Definition: AbstractAllTermDocs.h:12
Lucene::IndexReaderPtr
boost::shared_ptr< IndexReader > IndexReaderPtr
Definition: LuceneTypes.h:157
Lucene::SpanFirstQuery::end
int32_t end
Definition: SpanFirstQuery.h:26
Lucene::SpanFirstQuery::getMatch
SpanQueryPtr getMatch()
Return the SpanQuery whose matches are filtered.
Lucene::SpanFirstQuery::getEnd
int32_t getEnd()
Return the maximum end position permitted in a match.
Lucene::SpanFirstQuery::clone
virtual LuceneObjectPtr clone(const LuceneObjectPtr &other=LuceneObjectPtr())
Returns a clone of this query.
SpanQuery.h
Lucene::SpanFirstQuery::getField
virtual String getField()
Returns the name of the field matched by this query.
Lucene::SpansPtr
boost::shared_ptr< Spans > SpansPtr
Definition: LuceneTypes.h:453
Lucene::SpanFirstQuery::toString
virtual String toString(const String &field)
Prints a query to a string, with field assumed to be the default field and omitted.
Lucene::SpanFirstQuery
Matches spans near the beginning of a field.
Definition: SpanFirstQuery.h:16
Lucene::SpanFirstQuery::rewrite
virtual QueryPtr rewrite(const IndexReaderPtr &reader)
Called to re-write queries into primitive queries. For example, a PrefixQuery will be rewritten into ...
Lucene::SpanFirstQuery::getSpans
virtual SpansPtr getSpans(const IndexReaderPtr &reader)
Returns the matches for this query in an index. Used internally to search for spans.
Lucene::Query::toString
virtual String toString()
Prints a query to a string.
Spans.h

clucene.sourceforge.net