CDRH / api

Codenamed "Apium": An API to access all public Center for Digital Research in the Humanities resources
https://cdrhdev1.unl.edu/api_frontend
MIT License
3 stars 1 forks source link

Location querying research #103

Open jduss4 opened 4 years ago

jduss4 commented 4 years ago

If we store lat / lng in the correct field format, it should not be hard to add basic querying to API that could potentially would with Solr and Elasticsearch. Perhaps with circle range?

ES: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-geo-distance-query.html

{
    "query": {
        "bool" : {
            "must" : {
                "match_all" : {}
            },
            "filter" : {
                "geo_distance" : {
                    "distance" : "200km",
                    "pin.location" : {
                        "lat" : 40,
                        "lon" : -70
                    }
                }
            }
        }
    }
}

Solr: https://lucene.apache.org/solr/guide/6_6/spatial-search.html