Lucene++ - a full-featured, c++ search engine
API Documentation
Go to the documentation of this file.
7 #ifndef MULTIPHRASEQUERY_H
8 #define MULTIPHRASEQUERY_H
75 friend class MultiPhraseWeight;
virtual QueryPtr rewrite(const IndexReaderPtr &reader)
Called to re-write queries into primitive queries. For example, a PrefixQuery will be rewritten into ...
virtual LuceneObjectPtr clone(const LuceneObjectPtr &other=LuceneObjectPtr())
Returns a clone of this query.
#define LUCENE_CLASS(Name)
Definition: LuceneObject.h:24
boost::shared_ptr< Term > TermPtr
Definition: LuceneTypes.h:233
Utility template class to handle collections that can be safely copied and shared.
Definition: Collection.h:17
Collection< int32_t > positions
Definition: MultiPhraseQuery.h:28
Collection< int32_t > getPositions()
Returns the relative positions of terms in this phrase.
boost::shared_ptr< LuceneObject > LuceneObjectPtr
Definition: LuceneTypes.h:539
int32_t termArraysHashCode()
virtual ~MultiPhraseQuery()
Collection< Collection< TermPtr > > termArrays
Definition: MultiPhraseQuery.h:27
boost::shared_ptr< Query > QueryPtr
Definition: LuceneTypes.h:420
void add(Collection< TermPtr > terms)
Add multiple terms at the next position in the phrase. Any of the terms may match.
bool termArraysEquals(Collection< Collection< TermPtr > > first, Collection< Collection< TermPtr > > second)
int32_t getSlop()
Gets the phrase slop for this query.
void setSlop(int32_t s)
Sets the phrase slop for this query.
Definition: AbstractAllTermDocs.h:12
boost::shared_ptr< Weight > WeightPtr
Definition: LuceneTypes.h:480
int32_t slop
Definition: MultiPhraseQuery.h:29
boost::shared_ptr< IndexReader > IndexReaderPtr
Definition: LuceneTypes.h:157
virtual String toString(const String &field)
Prints a user-readable version of this query.
The abstract base class for queries.
Definition: Query.h:31
virtual int32_t hashCode()
Return hash code for this object.
MultiPhraseQuery is a generalized version of PhraseQuery, with an added method add(Term[])....
Definition: MultiPhraseQuery.h:18
virtual bool equals(const LuceneObjectPtr &other)
Return whether two objects are equal.
void add(const TermPtr &term)
Add a single term at the next position in the phrase.
virtual WeightPtr createWeight(const SearcherPtr &searcher)
Constructs an appropriate Weight implementation for this query. Only implemented by primitive queries...
String field
Definition: MultiPhraseQuery.h:23
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...
void add(Collection< TermPtr > terms, int32_t position)
Allows to specify the relative position of terms within the phrase.
Collection< Collection< TermPtr > > getTermArrays()
Returns a List of the terms in the multiphrase. Do not modify the List or its contents.
virtual String toString()
Prints a query to a string.
boost::shared_ptr< Searcher > SearcherPtr
Definition: LuceneTypes.h:434
clucene.sourceforge.net