Bug 37821 - Embed geographic coordinates when indexing biblios linked to GEOGR_NAME authorities
Summary: Embed geographic coordinates when indexing biblios linked to GEOGR_NAME autho...
Status: Failed QA
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-09-03 11:46 UTC by HKS3 Tadeusz Sośnierz
Modified: 2025-05-08 20:48 UTC (History)
2 users (show)

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


Attachments
Bug 37821: Embed geographic coordinates from GEOGR_NAME authority when indexing records (2.43 KB, patch)
2024-09-03 11:55 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-09-03 11:46:25 UTC
Items can be linked to GEOGR_NAME authorities, which in turn can have geographic coordinates stored in them. We have the functionality to search for items around geographic coordinates, but currently the indexer only indexes coordinates stored in 034 in the item itself, not in any authorities linked to it.

Embeding the coordinates from the GEOGR_NAME authority should have a negligible impact on the size of the index, and should make geo-tagging of items a lot easier.
Comment 1 HKS3 Tadeusz Sośnierz 2024-09-03 11:55:33 UTC
Created attachment 170979 [details] [review]
Bug 37821: Embed geographic coordinates from GEOGR_NAME authority when indexing records
Comment 2 HKS3 Tadeusz Sośnierz 2024-09-03 11:56:07 UTC
Test plan:

## Preparation

1. Set up koha-testing-docker with --es8
2. Go to "The beginnings of Rome" in staff view (http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=140)
3. Go to the linked authority record ("Rome -- History -- Kings, 753-510 B.C") by clicking the looking glass.
   Should end up at http://localhost:8081/cgi-bin/koha/authorities/detail.pl?authid=169
4. Click "edit record"
5. Add field 034 ("CODED CARTOGRAPHIC MATHEMATICAL DATA")
6. For subfieds `s` and `t` enter the coordinates for Rome: 41.89193 and 12.51133
7. Save the authority record

## Testing

8. In koha-shell, issue the elasticsearch query:

```
curl -X GET "es:9200/koha_kohadev_biblios/_search?pretty" -H 'Content-Type: application/json' -d'
{
  "query": {
    "bool": {
      "must": {
        "match_all": {}
      },
      "filter": {
        "geo_distance": {
          "distance": "100km",
          "geolocation": {
            "lat": 41.89,
            "lon": 12.51
          }
        }
      }
    }
  }
}
'
```

Note no results.

9. Apply the patch
10. Rebuild the index with `koha-elasticsearch --rebuild kohadev`
11. Re-run the elasticsearch query
12. Notice the expected book pop up
Comment 3 Roman Dolny 2025-05-08 20:48:32 UTC
Works as described, but qa script unhappy:

FAIL   Koha/SearchEngine/Elasticsearch.pm
  FAIL   pod coverage
               POD is missing for 'embed_geographic_name'
  FAIL   tidiness
               File is not tidy, please run `perl misc/devel/tidy.pl Koha/SearchEngine/Elasticsearch.pm`