From df7690a3c2090bfff83db4539a6de82d884e9fe8 Mon Sep 17 00:00:00 2001 From: Ivan Dziuba Date: Fri, 28 May 2021 16:38:29 -0400 Subject: [PATCH] Bug 27113: (follow-up) Correction with Session TEST PLAN Important! In this patch we need to do reindex ElasticSearch. ElasticSearch must have all information in his index. 1. Go Intranet -> Preference -> SearchEngine -> ElasticSearch !! APPLY PATCH !! 2. Mapping is good (Intranet -> Catalog -> Search engine configuration (Elasticsearch) ). !Recommended 'Reset Mapping' -> 'Yes' 3. In your koha-conf.xml file you must have good for and version ES 4. Update Preference: ./installer/data/mysql/updatedatabase.pl If that passe good you can look the lines: - DEV atomic update: bug_27113-elasticsearch_autocomplete_input_search.perl - Upgrade to XXX done : Bug 27113 - Autocomplete input on main page with elasticsearch 5. After that we can look two options in the preferences: - IntranetAutocompleteElasticSearch; - OPACAutocompleteElasticSearch; 4. For add information in the index we must run script for reindexing: ./misc/search_tools/rebuild_elasticsearch.pl -v -d 5. Waiting for the end of indexing 6. Go on Preference and find : - IntranetAutocompleteElasticSearch; - OPACAutocompleteElasticSearch; Value "Show" turn on autocomplete. 7. Now we have Autocomplete for Intranet/OPAC search input (advanced search also) --- api/elasticsearch/elasticsearch.pl | 2 +- opac/svc/elasticsearch/opac-elasticsearch.pl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/elasticsearch/elasticsearch.pl b/api/elasticsearch/elasticsearch.pl index 09a79bc045..718af730f4 100755 --- a/api/elasticsearch/elasticsearch.pl +++ b/api/elasticsearch/elasticsearch.pl @@ -11,7 +11,7 @@ use Koha::SearchEngine::Elasticsearch::Browse; my $browser = Koha::SearchEngine::Elasticsearch::Browse->new( { index => 'biblios' } ); my $cgi = CGI->new; -my $session = CGI::Session->new(); +my $session = CGI::Session->load() or die CGI::Session->errstr(); $session->param(-name=>'analyzer', -value=>"autocomplete"); $session->param(-name=>'prefix', -value=>$cgi->multi_param("prefix")); diff --git a/opac/svc/elasticsearch/opac-elasticsearch.pl b/opac/svc/elasticsearch/opac-elasticsearch.pl index 8934cd50c6..812b458855 100755 --- a/opac/svc/elasticsearch/opac-elasticsearch.pl +++ b/opac/svc/elasticsearch/opac-elasticsearch.pl @@ -11,7 +11,7 @@ use Koha::SearchEngine::Elasticsearch::Browse; my $browser = Koha::SearchEngine::Elasticsearch::Browse->new( { index => 'biblios' } ); my $cgi = CGI->new; -my $session = CGI::Session->new(); +my $session = CGI::Session->load() or die CGI::Session->errstr(); $session->param(-name=>'analyzer', -value=>"autocomplete"); $session->param(-name=>'prefix', -value=>$cgi->multi_param("prefix")); -- 2.17.1