|
xapian-core
2.0.0
|
KeyMaker subclass which sorts by distance from a latitude/longitude. More...
#include <geospatial.h>
Inheritance diagram for Xapian::LatLongDistanceKeyMaker:
Collaboration diagram for Xapian::LatLongDistanceKeyMaker:Public Member Functions | |
| LatLongDistanceKeyMaker (Xapian::valueno slot_, const LatLongCoords ¢re_, const LatLongMetric &metric_, double defdistance) | |
| Construct a LatLongDistanceKeyMaker. More... | |
| LatLongDistanceKeyMaker (Xapian::valueno slot_, const LatLongCoords ¢re_, const LatLongMetric &metric_) | |
| Construct a LatLongDistanceKeyMaker. More... | |
| LatLongDistanceKeyMaker (Xapian::valueno slot_, const LatLongCoords ¢re_) | |
| Construct a LatLongDistanceKeyMaker. More... | |
| LatLongDistanceKeyMaker (Xapian::valueno slot_, const LatLongCoord ¢re_, const LatLongMetric &metric_, double defdistance) | |
| Construct a LatLongDistanceKeyMaker. More... | |
| LatLongDistanceKeyMaker (Xapian::valueno slot_, const LatLongCoord ¢re_, const LatLongMetric &metric_) | |
| Construct a LatLongDistanceKeyMaker. More... | |
| LatLongDistanceKeyMaker (Xapian::valueno slot_, const LatLongCoord ¢re_) | |
| Construct a LatLongDistanceKeyMaker. More... | |
| ~LatLongDistanceKeyMaker () | |
| std::string | operator() (const Xapian::Document &doc) const |
| Build a key string for a Document. More... | |
Public Member Functions inherited from Xapian::KeyMaker | |
| KeyMaker () | |
| Default constructor. More... | |
| virtual | ~KeyMaker () |
| Virtual destructor, because we have virtual methods. More... | |
| virtual std::string | name () const |
| Return the name of this KeyMaker. More... | |
| virtual std::string | serialise () const |
| Return this object's parameters serialised as a single string. More... | |
| virtual KeyMaker * | unserialise (const std::string &serialised, const Registry &context) const |
| Unserialise parameters. More... | |
| KeyMaker * | release () |
| Start reference counting this object. More... | |
| const KeyMaker * | release () const |
| Start reference counting this object. More... | |
Public Member Functions inherited from Xapian::Internal::opt_intrusive_base | |
| opt_intrusive_base (const opt_intrusive_base &) | |
| opt_intrusive_base & | operator= (const opt_intrusive_base &) |
| opt_intrusive_base () | |
| Construct object which is initially not reference counted. More... | |
| virtual | ~opt_intrusive_base () |
| void | ref () const |
| void | unref () const |
Private Attributes | |
| Xapian::valueno | slot |
| The value slot to read. More... | |
| LatLongCoords | centre |
| The centre point (or points) for distance calculation. More... | |
| const LatLongMetric * | metric |
| The metric to use when calculating distances. More... | |
| std::string | defkey |
| The default key to return, for documents with no value stored. More... | |
Additional Inherited Members | |
Public Attributes inherited from Xapian::Internal::opt_intrusive_base | |
| unsigned | _refs |
| Reference count. More... | |
Protected Member Functions inherited from Xapian::Internal::opt_intrusive_base | |
| void | release () const |
| Start reference counting. More... | |
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.
Definition at line 550 of file geospatial.h.
|
inline |
Construct a LatLongDistanceKeyMaker.
| 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. |
Definition at line 573 of file geospatial.h.
|
inline |
Construct a LatLongDistanceKeyMaker.
| 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.
Definition at line 593 of file geospatial.h.
|
inline |
Construct a LatLongDistanceKeyMaker.
| 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.
Definition at line 613 of file geospatial.h.
|
inline |
Construct a LatLongDistanceKeyMaker.
| 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. |
Definition at line 628 of file geospatial.h.
References Xapian::LatLongCoords::append().
|
inline |
Construct a LatLongDistanceKeyMaker.
| 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.
Definition at line 649 of file geospatial.h.
References Xapian::LatLongCoords::append().
|
inline |
Construct a LatLongDistanceKeyMaker.
| 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.
Definition at line 670 of file geospatial.h.
References Xapian::LatLongCoords::append().
| LatLongDistanceKeyMaker::~LatLongDistanceKeyMaker | ( | ) |
Definition at line 45 of file latlong_distance_keymaker.cc.
|
virtual |
Build a key string for a Document.
These keys can be used for sorting or collapsing matching documents.
| doc | Document object to build a key for. |
Implements Xapian::KeyMaker.
Definition at line 33 of file latlong_distance_keymaker.cc.
References Xapian::Document::get_value(), Xapian::sortable_serialise(), and Xapian::LatLongCoords::unserialise().
|
private |
The centre point (or points) for distance calculation.
Definition at line 556 of file geospatial.h.
|
private |
The default key to return, for documents with no value stored.
Definition at line 562 of file geospatial.h.
|
private |
The metric to use when calculating distances.
Definition at line 559 of file geospatial.h.
|
private |
The value slot to read.
Definition at line 553 of file geospatial.h.