komoot / photon

an open source geocoder for openstreetmap data
Apache License 2.0
1.83k stars 278 forks source link

Introduce abstract result classes #651

Closed lonvia closed 2 years ago

lonvia commented 2 years ago

The second part of encapsulating ElasticSearch code. Introduces an abstract result class, where the ES subpackage implements the necessary accessors to its internal SearchHit class.

With the abstract result, the deduplication and conversion into the GeocodeJSON result can be moved into the generic handler part. The assumption here is that all database backends will use the same data schema. The abstract results just hids how the data is retrieved.