MITLibraries / timdex

TIMDEX Is Making Discovery EXcellent @ MIT
Apache License 2.0
5 stars 6 forks source link

Add support for spatial queries #213

Closed gravesm closed 5 months ago

gravesm commented 4 years ago

Proposal

Elasticsearch has support for several different kinds of spatial queries (https://www.elastic.co/guide/en/elasticsearch/reference/current/geo-queries.html). We should consider supporting some form of spatial querying.

Background

A lot of our MARC records have lat/lon points attached to them. All of our spatial data layers (none of which are in Aleph) have bounding boxes. It would be nice to have this information represented in the index in a meaningful way along with the ability to query it. GeoWeb already provides this level of access, but it is a silo. I don't think the goal would be to replace GeoWeb, but it might be something we could look at down the line.

Questions

  1. Is this even worth it? I'd guess the total number of items with usable spatial data is probably no more than 10,000.
  2. What does this look like in the query interface?
JPrevost commented 5 months ago

We finally got around to this:

https://timdex.mit.edu/playground?query=%7B%0A%20%20search(geodistance%3A%20%7Blatitude%3A%2042%2C%20longitude%3A%20-70%2C%20distance%3A%20%221%22%7D%2C%20index%3A%20%22geo%22)%20%7B%0A%20%20%20%20hits%0A%20%20%20%20records%20%7B%0A%20%20%20%20%20%20timdexRecordId%0A%20%20%20%20%20%20title%0A%20%20%20%20%20%20locations%20%7B%0A%20%20%20%20%20%20%20%20geoshape%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D

Or in the UI, https://geodata.libraries.mit.edu