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

SpanNearQuery.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 SPANNEARQUERY_H
8 #define SPANNEARQUERY_H
9
10 #include "SpanQuery.h"
11
12 namespace Lucene {
13
16 class LPPAPI SpanNearQuery : public SpanQuery {
17 public:
21 SpanNearQuery(Collection<SpanQueryPtr> clauses, int32_t slop, bool inOrder, bool collectPayloads = true);
22 virtual ~SpanNearQuery();
23
24 LUCENE_CLASS(SpanNearQuery);
25
26 protected:
27 Collection<SpanQueryPtr> clauses;
28 int32_t slop;
29 bool inOrder;
30
31 String field;
32 bool collectPayloads;
33
34 public:
35 using SpanQuery::toString;
36
38 Collection<SpanQueryPtr> getClauses();
39
41 int32_t getSlop();
42
44 bool isInOrder();
45
46 virtual String getField();
47 virtual void extractTerms(SetTerm terms);
48 virtual String toString(const String& field);
49 virtual SpansPtr getSpans(const IndexReaderPtr& reader);
50 virtual QueryPtr rewrite(const IndexReaderPtr& reader);
51 virtual LuceneObjectPtr clone(const LuceneObjectPtr& other = LuceneObjectPtr());
52 virtual bool equals(const LuceneObjectPtr& other);
53 virtual int32_t hashCode();
54 };
55
56 }
57
58 #endif
LUCENE_CLASS
#define LUCENE_CLASS(Name)
Definition: LuceneObject.h:24
SpanQuery.h
Lucene::Collection< SpanQueryPtr >
Lucene::Query::toString
virtual String toString()
Prints a query to a string.
Lucene::SpanNearQuery
Matches spans which are near one another. One can specify slop, the maximum number of intervening unm...
Definition: SpanNearQuery.h:16
Lucene::SpanNearQuery::clauses
Collection< SpanQueryPtr > clauses
Definition: SpanNearQuery.h:24
Lucene::SpanNearQuery::~SpanNearQuery
virtual ~SpanNearQuery()
Lucene::SpanNearQuery::toString
virtual String toString(const String &field)
Prints a query to a string, with field assumed to be the default field and omitted.
Lucene::SpanNearQuery::rewrite
virtual QueryPtr rewrite(const IndexReaderPtr &reader)
Called to re-write queries into primitive queries. For example, a PrefixQuery will be rewritten into ...
Lucene::SpanNearQuery::clone
virtual LuceneObjectPtr clone(const LuceneObjectPtr &other=LuceneObjectPtr())
Returns a clone of this query.
Lucene::SpanNearQuery::getSlop
int32_t getSlop()
Return the maximum number of intervening unmatched positions permitted.
Lucene::SpanNearQuery::SpanNearQuery
SpanNearQuery(Collection< SpanQueryPtr > clauses, int32_t slop, bool inOrder, bool collectPayloads=true)
Construct a SpanNearQuery. Matches spans matching a span from each clause, with up to slop total unma...
Lucene::SpanNearQuery::field
String field
Definition: SpanNearQuery.h:31
Lucene::SpanNearQuery::equals
virtual bool equals(const LuceneObjectPtr &other)
Return whether two objects are equal.
Lucene::SpanNearQuery::collectPayloads
bool collectPayloads
Definition: SpanNearQuery.h:32
Lucene::SpanNearQuery::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::SpanNearQuery::isInOrder
bool isInOrder()
Return true if matches are required to be in-order.
Lucene::SpanNearQuery::getField
virtual String getField()
Returns the name of the field matched by this query.
Lucene::SpanNearQuery::slop
int32_t slop
Definition: SpanNearQuery.h:28
Lucene::SpanNearQuery::hashCode
virtual int32_t hashCode()
Return hash code for this object.
Lucene::SpanNearQuery::inOrder
bool inOrder
Definition: SpanNearQuery.h:29
Lucene::SpanNearQuery::getSpans
virtual SpansPtr getSpans(const IndexReaderPtr &reader)
Returns the matches for this query in an index. Used internally to search for spans.
Lucene::SpanNearQuery::getClauses
Collection< SpanQueryPtr > getClauses()
Return the clauses whose spans are matched.
Lucene::SpanQuery
Base class for span-based queries.
Definition: SpanQuery.h:15
Lucene
Definition: AbstractAllTermDocs.h:12
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