barseghyanartur / graphene-elastic

Graphene Elasticsearch/OpenSearch (DSL) integration
https://pypi.org/project/graphene-elastic/
72 stars 17 forks source link

Geo-spatial backend #11

Open barseghyanartur opened 4 years ago

cjfd481980 commented 3 years ago

Hi @barseghyanartur, I would like tou help out on this feature. What should I do?

barseghyanartur commented 3 years ago

@cjfd481980:

First part

  1. Fork.
  2. Study geo-distance.
  3. Implement it as a filter backend.
  4. Write tests.
  5. Submit a PR.

Second part

  1. Implement the ordering.
cjfd481980 commented 3 years ago

Ok, have you make any progress to start with?

barseghyanartur commented 3 years ago

Not in this project, but this feature is implemented in django-elasticsearch-dsl-drf.

cjfd481980 commented 3 years ago

Hi @barseghyanartur I was able to resolve a GeoPoint as a InnerDoc, perhaps it could help as starting point

class Place(InnerDoc):
    lat = Float()
    lon = Float()

class User(Document):
    location=Object(Place)

that's how I saw django_elasticsearch_dsl.fields.GeoPointField saves a Point.