Bug 18610

Summary: ElasticSearch indexing of facets needs to be updated for newer Catmandu versions
Product: Koha Reporter: Nick Clemens <nick>
Component: SearchingAssignee: Tomás Cohen Arazi <tomascohen>
Status: RESOLVED DUPLICATE QA Contact: Testopia <testopia>
Severity: major    
Priority: P5 - low CC: tomascohen
Version: master   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 18434    
Bug Blocks:    
Attachments: Bug 18610: regression tests
Bug 18610: Make facet indexing append instead of overwrite so it works on newer Catmandu

Description Nick Clemens 2017-05-15 14:48:51 UTC
This is analogous to the problem on bug 18434 - in newer versions multiple mappings overwrite each other if not set to append. Bug 18434 takes care of main headings, facets need the same treatment and testing
Comment 1 Tomás Cohen Arazi 2017-05-15 15:17:11 UTC
Created attachment 63480 [details] [review]
Bug 18610: regression tests

This patch introduces tests fr K::SE::ES::Indexer::_convert_marc_to_json
to test the facets that get extracted from the sample record.

To test:
- Run
  $ sudo koha-shell kohadev
 k$ cd kohaclone
 k$ prove t/db_dependent/Koha_Elasticsearch_Indexer.t \
          t/db_dependent/Koha_Elasticsearch.t
=> FAIL: Test fails because only last field mapped for facetting is considered (overwrite behaviour).

Sponsored-by: ByWater Solutions
Comment 2 Tomás Cohen Arazi 2017-05-15 15:17:21 UTC
Created attachment 63481 [details] [review]
Bug 18610: Make facet indexing append instead of overwrite so it works on newer Catmandu

This patch makes get_fixer_rules add the $append string to the facets mapping as we did for
bug 18434.

To test:
- Run:
  $ sudo koha-shell kohadev
 k$ cd kohaclone
 k$ prove t/db_dependent/Koha_Elasticsearch_Indexer.t t/db_dependent/Koha_Elasticsearch.t
=> FAIL: Tests fail!
- Apply this patch
- Run:
 k$ prove t/db_dependent/Koha_Elasticsearch_Indexer.t t/db_dependent/Koha_Elasticsearch.t
=> SUCCESS: Tests are all green!
- Sign off :-D

Sponsored-by: ByWater Solutions
Comment 3 Tomás Cohen Arazi 2017-07-03 19:09:14 UTC

*** This bug has been marked as a duplicate of bug 18434 ***