Bug 37537 - Add bounding box variant to geo-search
Summary: Add bounding box variant to geo-search
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching - Elasticsearch (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement
Assignee: HKS3 Tadeusz Sośnierz
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-07-31 14:14 UTC by HKS3 Tadeusz Sośnierz
Modified: 2024-09-17 21:40 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Patch implementing 37537 (3.95 KB, patch)
2024-07-31 14:18 UTC, HKS3 Tadeusz Sośnierz
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description HKS3 Tadeusz Sośnierz 2024-07-31 14:14:15 UTC
Following up on https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31652, it would be useful to be able to search for records falling within a (rectangular, axis-aligned) bounding box.

The current solution allows looking up records within a specified distance from a given point. geo_bounding_box searches would allow for things like "given this map fragment, overlay all records that would be visible on it".
Comment 1 HKS3 Tadeusz Sośnierz 2024-07-31 14:18:32 UTC
Created attachment 169893 [details] [review]
Patch implementing 37537

Test plan to follow soon; will likely require https://github.com/HKS3/HKS3GeoSearch to be tested properly.
Comment 2 HKS3 Tadeusz Sośnierz 2024-08-02 14:45:25 UTC
Test plan:

1. Install the GeoSearch plugin https://github.com/HKS3/HKS3GeoSearch/releases/tag/v0.4
2. Either add visibility of 034s  and 034t in framework manually or issue the following commands in the database:

``` 
update marc_subfield_structure set hidden = 0 where tagfield = '034' and tagsubfield = 's' and frameworkcode = 'BKS';
update marc_subfield_structure set hidden = 0 where tagfield = '034' and tagsubfield = 't' and frameworkcode = 'BKS';
```

3. Add some location information using https://github.com/HKS3/HKS3GeoSearch/blob/main/scripts/insert_geo_data.pl
4. restart_all for a good measure
5. Go to Advanced OPAC search at /cgi-bin/koha/opac-search.pl; a Geographic Search should be visible at the bottom
6. Position the map at [48, 13] without changing the zoom level; the circle should just about be covering Munchen on the left and Linz on the right, with Wien being outside of it on the right
7. Perform the search, no results should come up. The query string should be along the lines of `lat:48 lng:13 distance:120km`
8. Go back to search, and back to [48, 13]. This time toggle the "Search visible area" to switch to bounding-box searches.
9. Perform the search. This time, 3 books should come up around the Vienna area. The query string should be along the lines of `boundingbox:53.54030739150022,0.9228515625000001,41.77131167976407,25.0927734375` (the exact numbers may very).
10. Celebrate the great success