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

Loading...
Searching...
No Matches
SpanFirstQuery.h
Go to the documentation of this file.
1
2// 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
22 LUCENE_CLASS(SpanFirstQuery);
23
24 protected:
25 SpanQueryPtr match;
26 int32_t end;
27
28 public:
29 using SpanQuery::toString;
30
32 SpanQueryPtr getMatch();
33
35 int32_t getEnd();
36
37 virtual String getField();
38 virtual String toString(const String& field);
39 virtual LuceneObjectPtr clone(const LuceneObjectPtr& other = LuceneObjectPtr());
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_CLASS
#define LUCENE_CLASS(Name)
Definition LuceneObject.h:24
SpanQuery.h
Spans.h
Lucene::SpanFirstQuery
Matches spans near the beginning of a field.
Definition SpanFirstQuery.h:16
Lucene::SpanFirstQuery::getEnd
int32_t getEnd()
Return the maximum end position permitted in a match.
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::SpanFirstQuery::end
int32_t end
Definition SpanFirstQuery.h:26
Lucene::SpanFirstQuery::clone
virtual LuceneObjectPtr clone(const LuceneObjectPtr &other=LuceneObjectPtr())
Returns a clone of this query.
Lucene::SpanFirstQuery::equals
virtual bool equals(const LuceneObjectPtr &other)
Return whether two objects are equal.
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::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::getField
virtual String getField()
Returns the name of the field matched by this query.
Lucene::SpanFirstQuery::~SpanFirstQuery
virtual ~SpanFirstQuery()
Lucene::SpanFirstQuery::getMatch
SpanQueryPtr getMatch()
Return the SpanQuery whose matches are filtered.
Lucene::SpanFirstQuery::match
SpanQueryPtr match
Definition SpanFirstQuery.h:25
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::hashCode
virtual int32_t hashCode()
Return hash code for this object.
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::SpanQuery
Base class for span-based queries.
Definition SpanQuery.h:15
Lucene
Definition AbstractAllTermDocs.h:12
Lucene::SpanQueryPtr
boost::shared_ptr< SpanQuery > SpanQueryPtr
Definition LuceneTypes.h:450
Lucene::LuceneObjectPtr
boost::shared_ptr< LuceneObject > LuceneObjectPtr
Definition LuceneTypes.h:539
Lucene::QueryPtr
boost::shared_ptr< Query > QueryPtr
Definition LuceneTypes.h:420
Lucene::SpansPtr
boost::shared_ptr< Spans > SpansPtr
Definition LuceneTypes.h:453
Lucene::IndexReaderPtr
boost::shared_ptr< IndexReader > IndexReaderPtr
Definition LuceneTypes.h:157

clucene.sourceforge.net