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

Loading...
Searching...
No Matches
SpanOrQuery.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 SPANORQUERY_H
8#define SPANORQUERY_H
9
10#include "SpanQuery.h"
11
12 namespace Lucene {
13
15 class LPPAPI SpanOrQuery : public SpanQuery {
16 public:
18 SpanOrQuery(Collection<SpanQueryPtr> clauses);
19 virtual ~SpanOrQuery();
20
21 LUCENE_CLASS(SpanOrQuery);
22
23 protected:
24 Collection<SpanQueryPtr> clauses;
25 String field;
26
27 public:
28 using SpanQuery::toString;
29
31 Collection<SpanQueryPtr> getClauses();
32
33 virtual String getField();
34 virtual void extractTerms(SetTerm terms);
35 virtual LuceneObjectPtr clone(const LuceneObjectPtr& other = LuceneObjectPtr());
36 virtual QueryPtr rewrite(const IndexReaderPtr& reader);
37 virtual String toString(const String& field);
38 virtual bool equals(const LuceneObjectPtr& other);
39 virtual int32_t hashCode();
40 virtual SpansPtr getSpans(const IndexReaderPtr& reader);
41
42 friend class OrSpans;
43};
44
45}
46
47#endif
LUCENE_CLASS
#define LUCENE_CLASS(Name)
Definition LuceneObject.h:24
SpanQuery.h
Lucene::Collection
Utility template class to handle collections that can be safely copied and shared.
Definition Collection.h:17
Lucene::SpanOrQuery
Matches the union of its clauses.
Definition SpanOrQuery.h:15
Lucene::SpanOrQuery::getSpans
virtual SpansPtr getSpans(const IndexReaderPtr &reader)
Returns the matches for this query in an index. Used internally to search for spans.
Lucene::SpanOrQuery::~SpanOrQuery
virtual ~SpanOrQuery()
Lucene::SpanOrQuery::clauses
Collection< SpanQueryPtr > clauses
Definition SpanOrQuery.h:24
Lucene::SpanOrQuery::getField
virtual String getField()
Returns the name of the field matched by this query.
Lucene::SpanOrQuery::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::SpanOrQuery::hashCode
virtual int32_t hashCode()
Return hash code for this object.
Lucene::SpanOrQuery::clone
virtual LuceneObjectPtr clone(const LuceneObjectPtr &other=LuceneObjectPtr())
Returns a clone of this query.
Lucene::SpanOrQuery::SpanOrQuery
SpanOrQuery(Collection< SpanQueryPtr > clauses)
Construct a SpanOrQuery merging the provided clauses.
Lucene::SpanOrQuery::toString
virtual String toString(const String &field)
Prints a query to a string, with field assumed to be the default field and omitted.
Lucene::SpanOrQuery::equals
virtual bool equals(const LuceneObjectPtr &other)
Return whether two objects are equal.
Lucene::SpanOrQuery::field
String field
Definition SpanOrQuery.h:25
Lucene::SpanOrQuery::rewrite
virtual QueryPtr rewrite(const IndexReaderPtr &reader)
Called to re-write queries into primitive queries. For example, a PrefixQuery will be rewritten into ...
Lucene::SpanOrQuery::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