geobtaa / geoportal

Big Ten Academic Alliance Geoportal
Other
10 stars 5 forks source link

Troubleshoot the disconnect between map searches and relevancy order of results #381

Closed karenmajewicz closed 2 years ago

karenmajewicz commented 3 years ago

Expected behavior:

  1. Go to maps.princeton.edu
  2. Zoom closely into Albion, Pennslyvania (found in the NW part of the state between Erie and Ashtabula; can use geosearch for assistance.)
  3. Note the top record (or nearly top) is from Penn State: https://maps.princeton.edu/catalog/0ea01ec7-a838-4911-bf87-6478514b2e51

What happens on BTAA Geoportal:

  1. Go to geo.btaa.org
  2. Zoom closely into Albion, Pennslyvania
  3. Click on map marker and note in the popup that it is for the same Penn State record. (Do not click into the record itself though)
  4. Click the Search Here button.
  5. Look at the list of search results. The Albion map is not on any of the first several pages of results.
karenmajewicz commented 2 years ago

See this GIF https://imgur.com/8yhqocI

ewlarson commented 2 years ago

GBL's spatial search feature should apply two boosts when searching via the map (bbox param):

  1. an IsWithin boost -- maps that have a bbox shape that entirely fits within the bbox param shape
  2. an Intersects boost -- maps that have a bbox shape that intersects the bbox param shape

In the B1G Geoportal, despite the Solr query including a boost query "bq"=>["locn_geometry:\"IsWithin... we're not seeing the "IsWithin" boost applied in the Solr debugQuery explain scoring algorithm results.

However, if I change the field used here from locn_geometry (location_geo3d type) to solr_bboxtype (bbox type) the bq boost is added to the result relevancy score and detailed in the Solr debugQuery explain scoring algorithm output.

  10000.0 = ConstantScore(+(+solr_bboxtype__xdl:F +(+solr_bboxtype__minX:[-95.350342 TO 1.7976931348623157E308] +solr_bboxtype__maxX:[-1.7976931348623157E308 TO -91.790771])) +(+solr_bboxtype__minY:[44.582643 TO 1.7976931348623157E308] +solr_bboxtype__maxY:[-1.7976931348623157E308 TO 46.278631]))^10000.0

Something about the location_geo3d field type and our solr query doesn't work. We'll need to use a bbox type field here instead.

ewlarson commented 2 years ago

Closing via https://github.com/geobtaa/geoportal/commit/ca9f2b6fead0f05ee7b6f6eb3b08b2ef1e94915b