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
12namespace Lucene {
13
52class LPPAPI FieldMaskingSpanQuery : public SpanQuery {
53public:
54 FieldMaskingSpanQuery(const SpanQueryPtr& maskedQuery, const String& maskedField);
56
58
59protected:
61 String field;
62
63public:
64 using SpanQuery::toString;
65
66 virtual String getField();
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
80};
81
82}
83
84#endif
#define LUCENE_CLASS(Name)
Definition LuceneObject.h:24
Wrapper to allow SpanQuery objects participate in composite single-field SpanQueries by 'lying' about...
Definition FieldMaskingSpanQuery.h:52
virtual SimilarityPtr getSimilarity(const SearcherPtr &searcher)
Returns the Similarity implementation to be used for this query. Subclasses may override this method ...
virtual WeightPtr createWeight(const SearcherPtr &searcher)
Constructs an appropriate Weight implementation for this query. Only implemented by primitive queries...
virtual String getField()
Returns the name of the field matched by this query.
virtual bool equals(const LuceneObjectPtr &other)
Return whether two objects are equal.
SpanQueryPtr maskedQuery
Definition FieldMaskingSpanQuery.h:60
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...
String field
Definition FieldMaskingSpanQuery.h:61
virtual LuceneObjectPtr clone(const LuceneObjectPtr &other=LuceneObjectPtr())
Returns a clone of this query.
FieldMaskingSpanQuery(const SpanQueryPtr &maskedQuery, const String &maskedField)
virtual String toString(const String &field)
Prints a query to a string, with field assumed to be the default field and omitted.
virtual SpansPtr getSpans(const IndexReaderPtr &reader)
Returns the matches for this query in an index. Used internally to search for spans.
virtual QueryPtr rewrite(const IndexReaderPtr &reader)
Called to re-write queries into primitive queries. For example, a PrefixQuery will be rewritten into ...
virtual int32_t hashCode()
Return hash code for this object.
Base class for span-based queries.
Definition SpanQuery.h:15
Definition AbstractAllTermDocs.h:12
boost::shared_ptr< SpanQuery > SpanQueryPtr
Definition LuceneTypes.h:450
boost::shared_ptr< LuceneObject > LuceneObjectPtr
Definition LuceneTypes.h:539
boost::shared_ptr< Query > QueryPtr
Definition LuceneTypes.h:420
boost::shared_ptr< Searcher > SearcherPtr
Definition LuceneTypes.h:434
boost::shared_ptr< Similarity > SimilarityPtr
Definition LuceneTypes.h:435
boost::shared_ptr< Spans > SpansPtr
Definition LuceneTypes.h:453
boost::shared_ptr< IndexReader > IndexReaderPtr
Definition LuceneTypes.h:157
boost::shared_ptr< Weight > WeightPtr
Definition LuceneTypes.h:480

clucene.sourceforge.net