| Summary: | Extend geo-search to support areas, not just points (MARC 034 subfields defg) | ||
|---|---|---|---|
| Product: | Koha | Reporter: | HKS3 Tadeusz Sośnierz <tadeusz> |
| Component: | Searching - Elasticsearch | Assignee: | HKS3 Tadeusz Sośnierz <tadeusz> |
| Status: | Failed QA --- | QA Contact: | Testopia <testopia> |
| Severity: | enhancement | ||
| Priority: | P5 - low | CC: | brendan, lucas, phil |
| Version: | Main | ||
| Hardware: | All | ||
| OS: | All | ||
| GIT URL: | Initiative type: | --- | |
| Sponsorship status: | --- | Comma delimited list of Sponsors: | |
| Crowdfunding goal: | 0 | Patch complexity: | --- |
| Documentation contact: | Documentation submission: | ||
| Text to go in the release notes: | Version(s) released in: | ||
| Circulation function: | |||
| Attachments: |
Bug 37985: Extend geo-search to support areas, not just points (MARC 034 subfields defg)
Bug 37985: Extend geo-search to support areas, not just points (MARC 034 subfields defg) Bug 37985: Extend geo-search to support areas, not just points (MARC 034 subfields defg) |
||
|
Description
HKS3 Tadeusz Sośnierz
2024-09-23 11:31:45 UTC
Created attachment 171877 [details] [review] Bug 37985: Extend geo-search to support areas, not just points (MARC 034 subfields defg) Created attachment 171878 [details] [review] Bug 37985: Extend geo-search to support areas, not just points (MARC 034 subfields defg) Test plan:
1. Run the following code to add geolocation data to a book:
```
use C4::Biblio;
use Koha::Biblios;
# Add the bounding box of Austria to a biblio
{
my $biblionumber = 139;
my $biblio = Koha::Biblios->find($biblionumber);
my $framework = $biblio->frameworkcode;
my $record = $biblio->metadata->record;
my @fields;
$fields[0] = MARC::Field->new('034','','',
'd' => 9.530833,
'e' => 17.160556,
'f' => 49.020556,
'g' => 46.3725,
);
$record->append_fields(@fields);
C4::Biblio::ModBiblio($record, $biblionumber, $framework);
}
```
2. Go to OPAC /cgi-bin/koha/opac-search.pl?advsearch=1&idx=geolocation&do=Search&q=lat%3A48.19538740833338+lng%3A16.30711931230611+distance%3A120km, observe no results
3. Apply the patch
4. Perform the required DB migration: `alter table search_field MODIFY COLUMN type enum('','string','date','number','boolean','sum','isbn','stdno','year','callnumber','geo_point', 'geo_shape');`
5. Rebuild the index: `koha-elasticsearch --rebuild -r kohadev`
6. Restart Koha: `koha-plack --restart kohadev`
7. Retry /cgi-bin/koha/opac-search.pl?advsearch=1&idx=geolocation&do=Search&q=lat%3A48.19538740833338+lng%3A16.30711931230611+distance%3A120km, see a result pop up.
Needs a rebase Created attachment 183158 [details] [review] Bug 37985: Extend geo-search to support areas, not just points (MARC 034 subfields defg) Some failures noticed by the QA tool: [FAIL] Koha/SearchEngine/Elasticsearch/QueryBuilder.pm FAIL tidiness File is not tidy, please run `perl misc/devel/tidy.pl Koha/SearchEngine/Elasticsearch/QueryBuilder.pm` [PASS] admin/searchengine/elasticsearch/field_config.yaml [PASS] admin/searchengine/elasticsearch/mappings.yaml [FAIL] installer/data/mysql/kohastructure.sql FAIL tinyint_has_boolean_flag The new column vendor_edi_accounts.po_is_basketname is using TINYINT(1) as type but is not defined as boolean in the schema file (Koha/Schema/Result/VendorEdiAccount.pm), see the SQL12 coding guideline |