4bed77da08
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> |
||
---|---|---|
.. | ||
searchengine/elasticsearch | ||
additional-fields.pl | ||
admin-home.pl | ||
adveditorshortcuts.pl | ||
aqbudgetperiods.pl | ||
aqbudgets.pl | ||
aqcontract.pl | ||
aqplan.pl | ||
audio_alerts.pl | ||
auth_subfields_structure.pl | ||
auth_tag_structure.pl | ||
authorised_values.pl | ||
authtypes.pl | ||
background_jobs.pl | ||
biblio_framework.pl | ||
branch_transfer_limits.pl | ||
branches.pl | ||
cash_registers.pl | ||
categories.pl | ||
check_budget_parent.pl | ||
check_parent_total.pl | ||
checkmarc.pl | ||
cities.pl | ||
classsources.pl | ||
clone-rules.pl | ||
columns_settings.pl | ||
columns_settings.yml | ||
credit_types.pl | ||
curbside_pickup.pl | ||
currency.pl | ||
debit_types.pl | ||
desks.pl | ||
didyoumean.pl | ||
edi_accounts.pl | ||
edi_ean_accounts.pl | ||
identity_providers.pl | ||
ill_batch_statuses.pl | ||
import_export_authtype.pl | ||
import_export_framework.pl | ||
item_circulation_alerts.pl | ||
items_search_field.pl | ||
items_search_fields.pl | ||
itemtypes.pl | ||
koha2marclinks.pl | ||
library_groups.pl | ||
localization.pl | ||
marc-overlay-rules.pl | ||
marc_subfields_structure.pl | ||
marctagstructure.pl | ||
matching-rules.pl | ||
oai_set_mappings.pl | ||
oai_sets.pl | ||
overdrive.pl | ||
patron-attr-types.pl | ||
preferences.pl | ||
record_sources.pl | ||
restrictions.pl | ||
search_filters.pl | ||
share_content.pl | ||
smart-rules.pl | ||
sms_providers.pl | ||
smtp_servers.pl | ||
sru_modmapping.pl | ||
systempreferences.pl | ||
transfer_limits.pl | ||
transport-cost-matrix.pl | ||
usage_statistics.pl | ||
z3950servers.pl |