Xapian: API Documentation: Xapian::LatLongDistanceKeyMaker Class Reference

xapian-core 1.4.31

Public Member Functions | List of all members
Xapian::LatLongDistanceKeyMaker Class Reference

KeyMaker subclass which sorts by distance from a latitude/longitude. More...

`#include <geospatial.h>`

Inheritance diagram for Xapian::LatLongDistanceKeyMaker:
[legend]

## Public Member Functions
| LatLongDistanceKeyMaker (Xapian::valueno slot_, const LatLongCoords &centre_, const LatLongMetric &metric_, double defdistance)
| Construct a LatLongDistanceKeyMaker.
| LatLongDistanceKeyMaker (Xapian::valueno slot_, const LatLongCoords &centre_, const LatLongMetric &metric_)
| Construct a LatLongDistanceKeyMaker.
| LatLongDistanceKeyMaker (Xapian::valueno slot_, const LatLongCoords &centre_)
| Construct a LatLongDistanceKeyMaker.
| LatLongDistanceKeyMaker (Xapian::valueno slot_, const LatLongCoord &centre_, const LatLongMetric &metric_, double defdistance)
| Construct a LatLongDistanceKeyMaker.
| LatLongDistanceKeyMaker (Xapian::valueno slot_, const LatLongCoord &centre_, const LatLongMetric &metric_)
| Construct a LatLongDistanceKeyMaker.
| LatLongDistanceKeyMaker (Xapian::valueno slot_, const LatLongCoord &centre_)
| Construct a LatLongDistanceKeyMaker.
std::string | operator() (const Xapian::Document &doc) const
| Build a key string for a Document.
Public Member Functions inherited from Xapian::KeyMaker
| KeyMaker ()
| Default constructor.
virtual | ~KeyMaker ()
| Virtual destructor, because we have virtual methods.
KeyMaker * | release ()
| Start reference counting this object.
const KeyMaker * | release () const
| Start reference counting this object.

## Detailed Description

KeyMaker subclass which sorts by distance from a latitude/longitude.

Experimental - see https://xapian.org/docs/deprecation#experimental-features

Results are ordered by the distance from a fixed point, or list of points, calculated according to the metric supplied. If multiple points are supplied (either in the constructor, or in the coordinates stored in a document), the closest pointwise distance is used.

If a document contains no coordinate stored in the specified slot, a special value for the distance will be used. This defaults to a large number, so that such results get a low rank, but may be specified by a constructor parameter.

## Constructor & Destructor Documentation

## ◆ LatLongDistanceKeyMaker() [1/6]

Xapian::LatLongDistanceKeyMaker::LatLongDistanceKeyMaker | ( | Xapian::valueno | slot_,
|  | const LatLongCoords & | centre_,
|  | const LatLongMetric & | metric_,
|  | double | defdistance )
| inline

Construct a LatLongDistanceKeyMaker.

Parameters

  slot_ | Value slot to use.
  centre_ | List of points to calculate distance from (closest distance is used).
  metric_ | LatLongMetric to use.
  defdistance | Distance to use for docs with no value set.

References Xapian::sortable_serialise().

## ◆ LatLongDistanceKeyMaker() [2/6]

Xapian::LatLongDistanceKeyMaker::LatLongDistanceKeyMaker | ( | Xapian::valueno | slot_,
|  | const LatLongCoords & | centre_,
|  | const LatLongMetric & | metric_ )
| inline

Construct a LatLongDistanceKeyMaker.

Parameters

  slot_ | Value slot to use.
  centre_ | List of points to calculate distance from (closest distance is used).
  metric_ | LatLongMetric to use.

Documents where no value is set are assumed to be a large distance away.

## ◆ LatLongDistanceKeyMaker() [3/6]

Xapian::LatLongDistanceKeyMaker::LatLongDistanceKeyMaker | ( | Xapian::valueno | slot_,
|  | const LatLongCoords & | centre_ )
| inline

Construct a LatLongDistanceKeyMaker.

Parameters

  slot_ | Value slot to use.
  centre_ | List of points to calculate distance from (closest distance is used).

Xapian::GreatCircleMetric is used as the metric.

Documents where no value is set are assumed to be a large distance away.

## ◆ LatLongDistanceKeyMaker() [4/6]

Xapian::LatLongDistanceKeyMaker::LatLongDistanceKeyMaker | ( | Xapian::valueno | slot_,
|  | const LatLongCoord & | centre_,
|  | const LatLongMetric & | metric_,
|  | double | defdistance )
| inline

Construct a LatLongDistanceKeyMaker.

Parameters

  slot_ | Value slot to use.
  centre_ | Point to calculate distance from.
  metric_ | LatLongMetric to use.
  defdistance | Distance to use for docs with no value set.

References Xapian::sortable_serialise().

## ◆ LatLongDistanceKeyMaker() [5/6]

Xapian::LatLongDistanceKeyMaker::LatLongDistanceKeyMaker | ( | Xapian::valueno | slot_,
|  | const LatLongCoord & | centre_,
|  | const LatLongMetric & | metric_ )
| inline

Construct a LatLongDistanceKeyMaker.

Parameters

  slot_ | Value slot to use.
  centre_ | Point to calculate distance from.
  metric_ | LatLongMetric to use.

Documents where no value is set are assumed to be a large distance away.

## ◆ LatLongDistanceKeyMaker() [6/6]

Xapian::LatLongDistanceKeyMaker::LatLongDistanceKeyMaker | ( | Xapian::valueno | slot_,
|  | const LatLongCoord & | centre_ )
| inline

Construct a LatLongDistanceKeyMaker.

Parameters

  slot_ | Value slot to use.
  centre_ | Point to calculate distance from.

Xapian::GreatCircleMetric is used as the metric.

Documents where no value is set are assumed to be a large distance away.

## Member Function Documentation

## ◆ operator()()

std::string Xapian::LatLongDistanceKeyMaker::operator() | ( | const Xapian::Document & | doc | ) | const
| virtual

Build a key string for a Document.

These keys can be used for sorting or collapsing matching documents.

Parameters

  doc | Document object to build a key for.

Implements Xapian::KeyMaker.

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

- xapian/geospatial.h