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

Loading...
Searching...
No Matches
FieldMaskingSpanQuery.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 FIELDMASKINGSPANQUERY_H
8#define FIELDMASKINGSPANQUERY_H
9
10#include "SpanQuery.h"
11
12 namespace Lucene {
13
52 class LPPAPI FieldMaskingSpanQuery : public SpanQuery {
53 public:
54 FieldMaskingSpanQuery(const SpanQueryPtr& maskedQuery, const String& maskedField);
55 virtual ~FieldMaskingSpanQuery();
56
57 LUCENE_CLASS(FieldMaskingSpanQuery);
58
59 protected:
60 SpanQueryPtr maskedQuery;
61 String field;
62
63 public:
64 using SpanQuery::toString;
65
66 virtual String getField();
67 SpanQueryPtr getMaskedQuery();
68 virtual SpansPtr getSpans(const IndexReaderPtr& reader);
69 virtual void extractTerms(SetTerm terms);
70 virtual WeightPtr createWeight(const SearcherPtr& searcher);
71 virtual SimilarityPtr getSimilarity(const SearcherPtr& searcher);
72 virtual QueryPtr rewrite(const IndexReaderPtr& reader);
73
74 virtual String toString(const String& field);
75 virtual bool equals(const LuceneObjectPtr& other);
76 virtual int32_t hashCode();
77
79 virtual LuceneObjectPtr clone(const LuceneObjectPtr& other = LuceneObjectPtr());
80};
81
82}
83
84#endif
LUCENE_CLASS
#define LUCENE_CLASS(Name)
Definition LuceneObject.h:24
SpanQuery.h
Lucene::FieldMaskingSpanQuery::getSimilarity
virtual SimilarityPtr getSimilarity(const SearcherPtr &searcher)
Returns the Similarity implementation to be used for this query. Subclasses may override this method ...
Lucene::FieldMaskingSpanQuery::createWeight
virtual WeightPtr createWeight(const SearcherPtr &searcher)
Constructs an appropriate Weight implementation for this query. Only implemented by primitive queries...
Lucene::FieldMaskingSpanQuery::getField
virtual String getField()
Returns the name of the field matched by this query.
Lucene::FieldMaskingSpanQuery::equals
virtual bool equals(const LuceneObjectPtr &other)
Return whether two objects are equal.
Lucene::FieldMaskingSpanQuery::maskedQuery
SpanQueryPtr maskedQuery
Definition FieldMaskingSpanQuery.h:60
Lucene::FieldMaskingSpanQuery::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::FieldMaskingSpanQuery::field
String field
Definition FieldMaskingSpanQuery.h:61
Lucene::FieldMaskingSpanQuery::clone
virtual LuceneObjectPtr clone(const LuceneObjectPtr &other=LuceneObjectPtr())
Returns a clone of this query.
Lucene::FieldMaskingSpanQuery::FieldMaskingSpanQuery
FieldMaskingSpanQuery(const SpanQueryPtr &maskedQuery, const String &maskedField)
Lucene::FieldMaskingSpanQuery::~FieldMaskingSpanQuery
virtual ~FieldMaskingSpanQuery()
Lucene::FieldMaskingSpanQuery::toString
virtual String toString(const String &field)
Prints a query to a string, with field assumed to be the default field and omitted.
Lucene::FieldMaskingSpanQuery::getSpans
virtual SpansPtr getSpans(const IndexReaderPtr &reader)
Returns the matches for this query in an index. Used internally to search for spans.
Lucene::FieldMaskingSpanQuery::getMaskedQuery
SpanQueryPtr getMaskedQuery()
Lucene::FieldMaskingSpanQuery::rewrite
virtual QueryPtr rewrite(const IndexReaderPtr &reader)
Called to re-write queries into primitive queries. For example, a PrefixQuery will be rewritten into ...
Lucene::FieldMaskingSpanQuery::hashCode
virtual int32_t hashCode()
Return hash code for this object.
Lucene::LuceneObject::toString
virtual String toString()
Returns a string representation of the object.
Lucene::SpanQuery
Base class for span-based queries.
Definition SpanQuery.h:15
Lucene
Definition AbstractAllTermDocs.h:12
Lucene::QueryPtr
boost::shared_ptr< Query > QueryPtr
Definition LuceneTypes.h:420
Lucene::WeightPtr
boost::shared_ptr< Weight > WeightPtr
Definition LuceneTypes.h:480
Lucene::SpansPtr
boost::shared_ptr< Spans > SpansPtr
Definition LuceneTypes.h:453
Lucene::SimilarityPtr
boost::shared_ptr< Similarity > SimilarityPtr
Definition LuceneTypes.h:435
Lucene::SearcherPtr
boost::shared_ptr< Searcher > SearcherPtr
Definition LuceneTypes.h:434
Lucene::LuceneObjectPtr
boost::shared_ptr< LuceneObject > LuceneObjectPtr
Definition LuceneTypes.h:539
Lucene::SpanQueryPtr
boost::shared_ptr< SpanQuery > SpanQueryPtr
Definition LuceneTypes.h:450
Lucene::IndexReaderPtr
boost::shared_ptr< IndexReader > IndexReaderPtr
Definition LuceneTypes.h:157

clucene.sourceforge.net