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

- Main Page
- Related Pages
- Namespaces
- Data Structures
- Files

- Data Structures
- Class Hierarchy
- Data Fields

All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | Static Public Member Functions | Protected Attributes
Lucene::SpanTermQuery Class Reference

Matches spans containing a term. More...

`#include <SpanTermQuery.h>`

Inheritance diagram for Lucene::SpanTermQuery:

## Public Member Functions

| SpanTermQuery (TermPtr term)
| Construct a SpanTermQuery matching the named term's spans. More...
virtual | ~SpanTermQuery ()
virtual String | getClassName ()
boost::shared_ptr< SpanTermQuery > | shared_from_this ()
TermPtr | getTerm ()
| Return the term whose spans are matched. More...
virtual String | getField ()
| Returns the name of the field matched by this query. More...
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 form. More...
virtual String | toString (const String &field)
| Prints a query to a string, with field assumed to be the default field and omitted. More...
virtual int32_t | hashCode ()
| Return hash code for this object. More...
virtual bool | equals (LuceneObjectPtr other)
| Return whether two objects are equal. More...
virtual LuceneObjectPtr | clone (LuceneObjectPtr other=LuceneObjectPtr())
| Returns a clone of this query. More...
virtual SpansPtr | getSpans (IndexReaderPtr reader)
| Returns the matches for this query in an index. Used internally to search for spans. More...
Public Member Functions inherited from Lucene::SpanQuery
virtual | ~SpanQuery ()
boost::shared_ptr< SpanQuery > | shared_from_this ()
virtual WeightPtr | createWeight (SearcherPtr searcher)
| Constructs an appropriate Weight implementation for this query. Only implemented by primitive queries, which re-write to themselves. More...
Public Member Functions inherited from Lucene::Query
| Query ()
virtual | ~Query ()
boost::shared_ptr< Query > | shared_from_this ()
virtual void | setBoost (double b)
| Sets the boost for this query clause to b. Documents matching this clause will (in addition to the normal weightings) have their score multiplied by b. More...
virtual double | getBoost ()
| Gets the boost for this clause. Documents matching this clause will (in addition to the normal weightings) have their score multiplied by b. The boost is 1.0 by default. More...
virtual String | toString ()
| Prints a query to a string. More...
virtual WeightPtr | weight (SearcherPtr searcher)
| Constructs and initializes a Weight for a top-level query. More...
virtual QueryPtr | rewrite (IndexReaderPtr reader)
| Called to re-write queries into primitive queries. For example, a PrefixQuery will be rewritten into a BooleanQuery that consists of TermQuerys. More...
virtual QueryPtr | combine (Collection< QueryPtr > queries)
| Called when re-writing queries under MultiSearcher. More...
virtual SimilarityPtr | getSimilarity (SearcherPtr searcher)
| Returns the Similarity implementation to be used for this query. Subclasses may override this method to specify their own Similarity implementation, perhaps one that delegates through that of the Searcher. By default the Searcher's Similarity implementation is returned. More...
String | boostString ()
| Return given boost value as a string. More...
Public Member Functions inherited from Lucene::LuceneObject
virtual | ~LuceneObject ()
virtual void | initialize ()
| Called directly after instantiation to create objects that depend on this object being fully constructed. More...
virtual int32_t | compareTo (LuceneObjectPtr other)
| Compare two objects. More...
Public Member Functions inherited from Lucene::LuceneSync
virtual | ~LuceneSync ()
virtual SynchronizePtr | getSync ()
| Return this object synchronize lock. More...
virtual LuceneSignalPtr | getSignal ()
| Return this object signal. More...
virtual void | lock (int32_t timeout=0)
| Lock this object using an optional timeout. More...
virtual void | unlock ()
| Unlock this object. More...
virtual bool | holdsLock ()
| Returns true if this object is currently locked by current thread. More...
virtual void | wait (int32_t timeout=0)
| Wait for signal using an optional timeout. More...
virtual void | notifyAll ()
| Notify all threads waiting for signal. More...

## Static Public Member Functions

static String | _getClassName ()
Static Public Member Functions inherited from Lucene::SpanQuery
static String | _getClassName ()
Static Public Member Functions inherited from Lucene::Query
static String | _getClassName ()
static QueryPtr | mergeBooleanQueries (Collection< BooleanQueryPtr > queries)
| Merges the clauses of a set of BooleanQuery's into a single BooleanQuery. More...

## Protected Attributes

TermPtr | term

## Additional Inherited Members

Protected Member Functions inherited from Lucene::LuceneObject
| LuceneObject ()

## Detailed Description

Matches spans containing a term.

## Constructor & Destructor Documentation

Lucene::SpanTermQuery::SpanTermQuery | ( | TermPtr | term) |  |

Construct a SpanTermQuery matching the named term's spans.

virtual Lucene::SpanTermQuery::~SpanTermQuery | ( | ) |  |

virtual

## Member Function Documentation

static String Lucene::SpanTermQuery::_getClassName | ( | ) |  |

inline static

virtual LuceneObjectPtr Lucene::SpanTermQuery::clone | ( | LuceneObjectPtr | other = `LuceneObjectPtr()`) |  |

virtual

Returns a clone of this query.

Reimplemented from Lucene::Query.

Reimplemented in Lucene::PayloadTermQuery.

virtual bool Lucene::SpanTermQuery::equals | ( | LuceneObjectPtr | other) |  |

virtual

Return whether two objects are equal.

Reimplemented from Lucene::Query.

Reimplemented in Lucene::PayloadTermQuery.

virtual void Lucene::SpanTermQuery::extractTerms | ( | SetTerm | terms) |  |

virtual

Adds all terms occurring in this query to the terms set. Only works if this query is in its rewritten form.

Reimplemented from Lucene::Query.

virtual String Lucene::SpanTermQuery::getClassName | ( | ) |  |

inline virtual

Reimplemented from Lucene::SpanQuery.

Reimplemented in Lucene::PayloadTermQuery.

virtual String Lucene::SpanTermQuery::getField | ( | ) |  |

virtual

Returns the name of the field matched by this query.

Implements Lucene::SpanQuery.

virtual SpansPtr Lucene::SpanTermQuery::getSpans | ( | IndexReaderPtr | reader) |  |

virtual

Returns the matches for this query in an index. Used internally to search for spans.

Implements Lucene::SpanQuery.

TermPtr Lucene::SpanTermQuery::getTerm | ( | ) |  |

Return the term whose spans are matched.

virtual int32_t Lucene::SpanTermQuery::hashCode | ( | ) |  |

virtual

Return hash code for this object.

Reimplemented from Lucene::Query.

Reimplemented in Lucene::PayloadTermQuery.

boost::shared_ptr< SpanTermQuery > Lucene::SpanTermQuery::shared_from_this | ( | ) |  |

inline

virtual String Lucene::SpanTermQuery::toString | ( | const String & | field) |  |

virtual

Prints a query to a string, with field assumed to be the default field and omitted.

The representation used is one that is supposed to be readable by QueryParser. However, there are the following limitations:

If the query was created by the parser, the printed representation may not be exactly what was parsed. For example, characters that need to be escaped will be represented without the required backslash.

Some of the more complicated queries (eg. span queries) don't have a representation that can be parsed by QueryParser.

Reimplemented from Lucene::Query.

## Field Documentation

TermPtr Lucene::SpanTermQuery::term

protected

The documentation for this class was generated from the following file:

- SpanTermQuery.h

clucene.sourceforge.net