Koha/admin
Mark Hofstetter 4bed77da08
Bug 31652: Add geo-search
This patch adds geosearch to Koha (using Elasticsearch 7). ElasticSearch
search_mappings get new types to store lat/lon, which can be indexed
from MARC 034$s and 034$t. There is a small change to the DB to allow a
new value in search_field.type ENUM.

The QueryBuilder is extended to allow for building advanced
ElasticSearch Querys (eg geo_distance) that cannot be represented in a
simple string query. The UI for searching (including showing the results
on a OSM/Leaflet map) is implemented in a separate plugin
(https://github.com/HKS3/HKS3GeoSearch)

Test Plan:

* make sure you're running ElasticSearch 7
  (eg via `curl http://es:9200?pretty | grep number`)
* apply patch
* got to a Framework, check Editor for 034$s and 034$t and save
* got to some books (in the correct framework) and enter some lat and lon into 034$s and 034$t (for example lat=48.216, lon=16.395)
* Run the elasticsearch indexer, maybe limited on the books you edited (-bn 123 -bn 456):
  misc/search_tools/rebuild_elasticsearch.pl -b -v
* You can check if the indexing worked by inspecting the document in elasticsearch:
  * get the biblionumber (eg 123)
  * curl http://es:9200/koha_kohadev_biblios/_doc/123?pretty | grep -A5 geolocation
  * You should get back a JSON fragment containing the lat/lon you stored
* You can query elasticsearch directly:
  * Run the following curl command, but adapt the value for lat/lng and/or the distance (in meters)
  * curl -X GET "http://es:9200/koha_kohadev_biblios/_search?pretty" -H 'Content-Type: application/json' -d '{"query": {"bool":{"must":{"match_all":{}},"filter":{"geo_distance":{"distance":100000,"geolocation":{"lat":48.2,"lon":16.4}}}}}}'
* To run the search via Koha, you need to either install and use https://github.com/HKS3/HKS3GeoSearch or create a handcrafted query string:
  * handcrafted query string:
    * /cgi-bin/koha/opac-search.pl?advsearch=1&idx=geolocation&q=lat:48.25+lng:18.35+distance:100km&do=Search
  * HKS3GeoSearch
    * install the plugin and enable it
    * got to OPAC / Advanced Search
    * There is a new input box "Geographic Search" where you can enter lat/long/radius
    * On the search result page a map is shown with pins for each found biblioitem

Sponsored-by: ZAMG - Zentralanstalt für Meterologie und Geodynamik, Austria - https://www.zamg.ac.at/
Sponsored-by: Geosphere - https://www.geosphere.at/
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Additional finetuning:

- Fix update and remove fixed fixme
- Update test count as well
- fix last small issues raised in Comment 23

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-04-29 15:19:34 +02:00
..
searchengine/elasticsearch Bug 31652: Add geo-search 2024-04-29 15:19:34 +02:00
additional-fields.pl Bug 34478: op =~ ^cud- in pl/pm 2024-03-01 10:56:11 +01:00
admin-home.pl Bug 36206: (QA follow-up) Tidy admin-home.pl 2024-04-26 14:14:56 +02:00
adveditorshortcuts.pl Bug 34478: op =~ ^cud- in pl/pm 2024-03-01 10:56:11 +01:00
aqbudgetperiods.pl Bug 34478: op =~ ^cud- in pl/pm 2024-03-01 10:56:11 +01:00
aqbudgets.pl Bug 34478: op =~ ^cud- in pl/pm 2024-03-01 10:56:11 +01:00
aqcontract.pl Bug 34478: op =~ ^cud- in pl/pm 2024-03-01 10:56:11 +01:00
aqplan.pl Bug 34478: op =~ ^cud- in pl/pm 2024-03-01 10:56:11 +01:00
audio_alerts.pl Bug 34478: Manual fix - audio alerts 2024-03-01 10:59:02 +01:00
auth_subfields_structure.pl Bug 34478: Authority frameworks - first subfield delete button has incorrect op value 2024-03-01 10:59:21 +01:00
auth_tag_structure.pl Bug 34478: op =~ ^cud- in pl/pm 2024-03-01 10:56:11 +01:00
authorised_values.pl Bug 34478: op =~ ^cud- in pl/pm 2024-03-01 10:56:11 +01:00
authtypes.pl Bug 34478: op =~ ^cud- in pl/pm 2024-03-01 10:56:11 +01:00
background_jobs.pl Bug 34478: op =~ ^cud- in pl/pm 2024-03-01 10:56:11 +01:00
biblio_framework.pl Bug 34478: op =~ ^cud- in pl/pm 2024-03-01 10:56:11 +01:00
branch_transfer_limits.pl Bug 34478: Manual fix - add op admin/branch_transfer_limits 2024-03-01 10:57:53 +01:00
branches.pl Bug 6796: Take CalenderFirstDayOfWeek and TimeFormat into account 2024-04-12 11:26:08 +02:00
cash_registers.pl Bug 36193: cud- treatment for cash_registers.pl 2024-03-12 17:47:29 +01:00
categories.pl Bug 34478: op =~ ^cud- in pl/pm 2024-03-01 10:56:11 +01:00
check_budget_parent.pl
check_parent_total.pl Bug 34478: op =~ ^cud- in pl/pm 2024-03-01 10:56:11 +01:00
checkmarc.pl
cities.pl Bug 34478: Cities - Incorrect op check for cud-delete_confirm 2024-03-01 10:59:23 +01:00
classsources.pl Bug 34478: Classification config - Convert delete links to form POSTS 2024-03-01 10:59:24 +01:00
clone-rules.pl Bug 34478: Add 'op' to admin/smart-rules 2024-03-01 10:58:24 +01:00
columns_settings.pl Bug 34478: Fix op check in table settings admin 2024-03-01 10:59:27 +01:00
columns_settings.yml Bug 16122: Add display and Table settings 2024-04-26 14:15:00 +02:00
credit_types.pl Bug 36193: cud- treatment for credit_types.pl 2024-03-12 17:47:29 +01:00
curbside_pickup.pl Bug 34478: op =~ ^cud- in pl/pm 2024-03-01 10:56:11 +01:00
currency.pl Bug 34478: op =~ ^cud- in pl/pm 2024-03-01 10:56:11 +01:00
debit_types.pl Bug 36193: cud- treatment for debit_types.pl 2024-03-12 17:47:30 +01:00
desks.pl Bug 36597: Fix deletion of circulation desks broken by CSRF 2024-04-18 16:51:11 +02:00
didyoumean.pl
edi_accounts.pl Bug 35724: Define non-standard ports for EDI SFTP in EDI accounts 2024-04-19 18:31:36 +02:00
edi_ean_accounts.pl Bug 34478: op =~ ^cud- in pl/pm 2024-03-01 10:56:11 +01:00
identity_providers.pl Bug 34478: op =~ ^cud- in pl/pm 2024-03-01 10:56:11 +01:00
ill_batch_statuses.pl Bug 35581: Illbatchstatus* -> ILL::Batch::Status* 2024-04-22 08:57:42 +02:00
import_export_authtype.pl Bug 34478: import_export_authtype - cud-import, export 2024-03-01 11:00:01 +01:00
import_export_framework.pl Bug 34478: Rename action with op - import_export_framework 2024-03-01 10:56:49 +01:00
item_circulation_alerts.pl Bug 34478: Fix op variable in item circulation alerts 2024-03-01 10:59:31 +01:00
items_search_field.pl Bug 34478: op =~ ^cud- in pl/pm 2024-03-01 10:56:11 +01:00
items_search_fields.pl Bug 34478: op =~ ^cud- in pl/pm 2024-03-01 10:56:11 +01:00
itemtypes.pl Bug 34478: Item type deletion - correct delete_confirm and delete_confirmed 2024-03-01 10:59:33 +01:00
koha2marclinks.pl Bug 34478: Changes for admin/koha2marclinks 2024-03-01 10:57:44 +01:00
library_groups.pl Bug 34478: Rename action with op - admin/library_groups 2024-03-01 10:56:37 +01:00
localization.pl
marc-overlay-rules.pl Bug 34478: Add 'op' to admin/marc-overlay-rules 2024-03-01 10:58:26 +01:00
marc_subfields_structure.pl Bug 36395: Remove useless fetch in admin/marc_subfields_structure.pl 2024-04-05 11:51:16 +02:00
marctagstructure.pl Bug 34478: op =~ ^cud- in pl/pm 2024-03-01 10:56:11 +01:00
matching-rules.pl Bug 34478: Manual fix - admin/matching-rules 2024-03-01 10:59:53 +01:00
oai_set_mappings.pl Bug 34478: op =~ ^cud- in pl/pm 2024-03-01 10:56:11 +01:00
oai_sets.pl Bug 34478: Corrections to add and delete of OAI sets 2024-03-01 10:59:34 +01:00
overdrive.pl Bug 34478: op =~ ^cud- in pl/pm 2024-03-01 10:56:11 +01:00
patron-attr-types.pl Bug 34478: Manual fix - admin/patron-attr-types 2024-03-01 10:59:54 +01:00
preferences.pl Bug 34478: op =~ ^cud- in pl/pm - Manual preferences.pl 2024-03-01 10:56:30 +01:00
record_sources.pl Bug 35919: Add record sources admin page 2024-04-26 17:06:04 +02:00
restrictions.pl Bug 36193: cud- treatment for restrictions.pl 2024-03-12 17:47:31 +01:00
search_filters.pl Bug 34478: op =~ ^cud- in pl/pm 2024-03-01 10:56:11 +01:00
share_content.pl Bug 34478: op =~ ^cud- in pl/pm - Manual cud-email => email 2024-03-01 10:57:14 +01:00
smart-rules.pl Bug 36447: Circ rules slow to load when many itemtypes and categories 2024-04-02 17:59:11 +02:00
sms_providers.pl Bug 34478: op =~ ^cud- in pl/pm 2024-03-01 10:56:11 +01:00
smtp_servers.pl Bug 34478: Correct value of "op" when loading the edit form. 2024-03-01 10:59:36 +01:00
sru_modmapping.pl
systempreferences.pl Bug 34478: op =~ ^cud- in pl/pm 2024-03-01 10:56:11 +01:00
transfer_limits.pl
transport-cost-matrix.pl Bug 34478: op =~ ^cud- in pl/pm 2024-03-01 10:56:11 +01:00
usage_statistics.pl Bug 34478: op =~ ^cud- in pl/pm 2024-03-01 10:56:11 +01:00
z3950servers.pl Bug 34478: Manual fix - Remove cud-search from z3950-admin-search.inc 2024-03-01 10:59:10 +01:00