Bug 23137 - Add a command line tool to reset elasticsearch mappings
Summary: Add a command line tool to reset elasticsearch mappings
Status: Pushed to oldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching - Elasticsearch (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Nick Clemens
QA Contact:
URL:
Keywords:
Depends on:
Blocks: 25278
  Show dependency treegraph
 
Reported: 2019-06-17 17:26 UTC by Nick Clemens
Modified: 2020-05-15 18:47 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:
20.05.00, 19.11.06


Attachments
Bug 23137: Add reset option to rebuild_elasticsearch.pl (3.16 KB, patch)
2020-03-19 16:45 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 23137: Add reset and delete to koha-elasticsearch (1.74 KB, patch)
2020-03-19 16:45 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 23137: Add reset option to rebuild_elasticsearch.pl (3.23 KB, patch)
2020-04-03 12:57 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug 23137: Add reset and delete to koha-elasticsearch (1.81 KB, patch)
2020-04-03 12:57 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug 23137: Add documentation (1.55 KB, patch)
2020-04-14 10:14 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 23137: Move cache flushing to the method (4.72 KB, patch)
2020-04-15 14:38 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 23137: Move cache flushing to the method (4.79 KB, patch)
2020-04-24 10:41 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 23137: Add reset option to rebuild_elasticsearch.pl (3.29 KB, patch)
2020-04-24 11:05 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 23137: Add reset and delete to koha-elasticsearch (1.88 KB, patch)
2020-04-24 11:05 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 23137: Add documentation (1.51 KB, patch)
2020-04-24 11:05 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 23137: Move cache flushing to the method (4.85 KB, patch)
2020-04-24 11:05 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens 2019-06-17 17:26:50 UTC
It would be useful to have this option from the command line

Possibly as part of koha-elasticsearch
Comment 1 Nick Clemens 2020-03-19 16:45:16 UTC
Created attachment 101051 [details] [review]
Bug 23137: Add reset option to rebuild_elasticsearch.pl

Setup:
1 - Be using Elasticsearch
2 - Reload mappings from the db
    Admin->Search configuration
    Reset Mappings
3 - Reindex ES and confirm searching is working

To test:
1 - Apply patch
2 - Alter your mappings file for elastic (just change a description for a field)
3 - perl misc/search_tools/rebuild_elasticsearch.pl -r -v
    Verbose not necessary, but good for letting you know things are progressing
4 - Confirm the mapping change shows in the interface
5 - Confirm reindex worked and searching is working
Comment 2 Nick Clemens 2020-03-19 16:45:18 UTC
Created attachment 101052 [details] [review]
Bug 23137: Add reset and delete to koha-elasticsearch

Same as previous test, but use the script to run the reindex
reset_all to update the scripts or use
misc4dev/cp_debian_files.pl

sudo koha-elasticsearch --rebuild -r -v
Comment 3 Andrew Fuerste-Henry 2020-04-03 12:57:34 UTC
Created attachment 102354 [details] [review]
Bug 23137: Add reset option to rebuild_elasticsearch.pl

Setup:
1 - Be using Elasticsearch
2 - Reload mappings from the db
    Admin->Search configuration
    Reset Mappings
3 - Reindex ES and confirm searching is working

To test:
1 - Apply patch
2 - Alter your mappings file for elastic (just change a description for a field)
3 - perl misc/search_tools/rebuild_elasticsearch.pl -r -v
    Verbose not necessary, but good for letting you know things are progressing
4 - Confirm the mapping change shows in the interface
5 - Confirm reindex worked and searching is working

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 4 Andrew Fuerste-Henry 2020-04-03 12:57:36 UTC
Created attachment 102355 [details] [review]
Bug 23137: Add reset and delete to koha-elasticsearch

Same as previous test, but use the script to run the reindex
reset_all to update the scripts or use
misc4dev/cp_debian_files.pl

sudo koha-elasticsearch --rebuild -r -v

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 5 Jonathan Druart 2020-04-13 12:17:22 UTC
Please add doc to debian/docs/koha-elasticsearch.xml
Comment 6 Nick Clemens 2020-04-14 10:14:27 UTC
Created attachment 102918 [details] [review]
Bug 23137: Add documentation
Comment 7 Jonathan Druart 2020-04-14 10:44:12 UTC
Should not we have the cache clearing in reset_elasticsearch_mappings?
Comment 8 Jonathan Druart 2020-04-15 14:38:32 UTC
Created attachment 103014 [details] [review]
Bug 23137: Move cache flushing to the method
Comment 9 Nick Clemens 2020-04-24 10:41:48 UTC
Created attachment 103640 [details] [review]
Bug 23137: Move cache flushing to the method

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 10 Jonathan Druart 2020-04-24 11:05:44 UTC
Created attachment 103647 [details] [review]
Bug 23137: Add reset option to rebuild_elasticsearch.pl

Setup:
1 - Be using Elasticsearch
2 - Reload mappings from the db
    Admin->Search configuration
    Reset Mappings
3 - Reindex ES and confirm searching is working

To test:
1 - Apply patch
2 - Alter your mappings file for elastic (just change a description for a field)
3 - perl misc/search_tools/rebuild_elasticsearch.pl -r -v
    Verbose not necessary, but good for letting you know things are progressing
4 - Confirm the mapping change shows in the interface
5 - Confirm reindex worked and searching is working

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 11 Jonathan Druart 2020-04-24 11:05:48 UTC
Created attachment 103648 [details] [review]
Bug 23137: Add reset and delete to koha-elasticsearch

Same as previous test, but use the script to run the reindex
reset_all to update the scripts or use
misc4dev/cp_debian_files.pl

sudo koha-elasticsearch --rebuild -r -v

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 12 Jonathan Druart 2020-04-24 11:05:51 UTC
Created attachment 103649 [details] [review]
Bug 23137: Add documentation

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 13 Jonathan Druart 2020-04-24 11:05:55 UTC
Created attachment 103650 [details] [review]
Bug 23137: Move cache flushing to the method

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 14 Martin Renvoize 2020-04-29 16:35:54 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 15 Joy Nelson 2020-05-08 22:49:30 UTC
backported to 19.11.x for 19.11.06
Comment 16 Lucas Gass 2020-05-15 15:46:45 UTC
Patchset does not apply clean to 19.05.x, no backport