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

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

- Data Structures
- Class Hierarchy
- Data Fields

Public Member Functions | Static Public Member Functions | Protected Attributes
Lucene::SpanWeight Class Reference

Public for use by other weight implementations. More...

`#include <SpanWeight.h>`

Inheritance diagram for Lucene::SpanWeight:

## Public Member Functions

| SpanWeight (const SpanQueryPtr &query, const SearcherPtr &searcher)
virtual | ~SpanWeight ()
virtual String | getClassName ()
boost::shared_ptr< SpanWeight > | shared_from_this ()
virtual QueryPtr | getQuery ()
| The query that this concerns. More...
virtual double | getValue ()
| The weight for this query. More...
virtual double | sumOfSquaredWeights ()
| The sum of squared weights of contained query clauses. More...
virtual void | normalize (double norm)
| Assigns the query normalization factor to this. More...
virtual ScorerPtr | scorer (const IndexReaderPtr &reader, bool scoreDocsInOrder, bool topScorer)
| Returns a Scorer which scores documents in/out-of order according to scoreDocsInOrder. More...
virtual ExplanationPtr | explain (const IndexReaderPtr &reader, int32_t doc)
| An explanation of the score computation for the named document. More...
Public Member Functions inherited from Lucene::Weight
virtual | ~Weight ()
boost::shared_ptr< Weight > | shared_from_this ()
virtual bool | scoresDocsOutOfOrder ()
| Returns true if this implementation scores docs only out of order. This method is used in conjunction with Collector's acceptsDocsOutOfOrder and scorer(IndexReaderPtr, bool, bool) to create a matching Scorer instance for a given Collector, or vice versa. 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 LuceneObjectPtr | clone (const LuceneObjectPtr &other=LuceneObjectPtr())
| Return clone of this object. More...
virtual int32_t | hashCode ()
| Return hash code for this object. More...
virtual bool | equals (const LuceneObjectPtr &other)
| Return whether two objects are equal. More...
virtual int32_t | compareTo (const LuceneObjectPtr &other)
| Compare two objects. More...
virtual String | toString ()
| Returns a string representation of the object. 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::Weight
static String | _getClassName ()

## Protected Attributes

SimilarityPtr | similarity
double | value
double | idf
double | queryNorm
double | queryWeight
SetTerm | terms
SpanQueryPtr | query
IDFExplanationPtr | idfExp
Protected Attributes inherited from Lucene::LuceneSync
SynchronizePtr | objectLock
LuceneSignalPtr | objectSignal

## Additional Inherited Members

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

## Detailed Description

Public for use by other weight implementations.

## Constructor & Destructor Documentation

Lucene::SpanWeight::SpanWeight | ( | const SpanQueryPtr & | query,
|  | const SearcherPtr & | searcher
| ) |  |

virtual Lucene::SpanWeight::~SpanWeight | ( |  | ) |

virtual

## Member Function Documentation

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

inline static

virtual ExplanationPtr Lucene::SpanWeight::explain | ( | const IndexReaderPtr & | reader,
|  | int32_t | doc
| ) |  |

virtual

An explanation of the score computation for the named document.

Parameters

  reader | sub-reader containing the give doc
  doc |

Returns
  an Explanation for the score

Implements Lucene::Weight.

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

inline virtual

Reimplemented from Lucene::Weight.

Reimplemented in Lucene::PayloadNearSpanWeight.

virtual QueryPtr Lucene::SpanWeight::getQuery | ( |  | ) |

virtual

The query that this concerns.

Implements Lucene::Weight.

virtual double Lucene::SpanWeight::getValue | ( |  | ) |

virtual

The weight for this query.

Implements Lucene::Weight.

virtual void Lucene::SpanWeight::normalize | ( | double | norm | ) |

virtual

Assigns the query normalization factor to this.

Implements Lucene::Weight.

virtual ScorerPtr Lucene::SpanWeight::scorer | ( | const IndexReaderPtr & | reader,
|  | bool | scoreDocsInOrder,
|  | bool | topScorer
| ) |  |

virtual

Returns a Scorer which scores documents in/out-of order according to scoreDocsInOrder.

NOTE: even if scoreDocsInOrder is false, it is recommended to check whether the returned Scorer indeed scores documents out of order (ie., call scoresDocsOutOfOrder()), as some Scorer implementations will always return documents in-order.

NOTE: null can be returned if no documents will be scored by this query.

Parameters

  reader | The IndexReader for which to return the Scorer.

  scoreDocsInOrder

  Specifies whether in-order scoring of documents is required. Note that if set to false (i.e., out-of-order scoring is required), this method can return whatever scoring mode it supports, as every in-order scorer is also an out-of-order one. However, an out-of-order scorer may not support Scorer#nextDoc() and/or Scorer#advance(int), therefore it is recommended to request an in-order scorer if use of these methods is required.

  topScorer | If true, Scorer#score(CollectorPtr) will be called; if false, Scorer#nextDoc() and/or Scorer#advance(int) will be called.

Returns
  a Scorer which scores documents in/out-of order.

Implements Lucene::Weight.

Reimplemented in Lucene::PayloadNearSpanWeight.

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

inline

virtual double Lucene::SpanWeight::sumOfSquaredWeights | ( |  | ) |

virtual

The sum of squared weights of contained query clauses.

Implements Lucene::Weight.

## Field Documentation

double Lucene::SpanWeight::idf

protected

IDFExplanationPtr Lucene::SpanWeight::idfExp

protected

SpanQueryPtr Lucene::SpanWeight::query

protected

double Lucene::SpanWeight::queryNorm

protected

double Lucene::SpanWeight::queryWeight

protected

SimilarityPtr Lucene::SpanWeight::similarity

protected

SetTerm Lucene::SpanWeight::terms

protected

double Lucene::SpanWeight::value

protected

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

- SpanWeight.h

clucene.sourceforge.net