https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17885

--- Comment #3 from Olli-Antti Kivilahti <[email protected]> ---
Hi.

You can recreate the problem with this:

perl -e 'use Koha::SearchEngine::Elasticsearch;
Koha::SearchEngine::Elasticsearch->reset_elasticsearch_mappings'



Your solution looks very simple :)
Unfortunately there is a bunch of business logic clumped together in the
/admin/searchengine/elasticsearch/mappings.pl
And I don't think business logic belongs to a controller module. Simply because
that functionality is needed when writing tests. When writing tests it is
better to call that one subroutine reset_elasticsearch_mappings instead of the
bunch of code in mappings.pl

If a subroutine says reset_elasticsearch_mappings(), I expect it to reset the
elasticsearch mappings without errors.

A simple solution would be to move:
        Koha::SearchMarcMaps->search->delete;
inside 
        Koha::SearchEngine::Elasticsearch->reset_elasticsearch_mappings;

which might be a better one than the DBIC-monster I created.

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to