Bug 31537

Summary: Elasticsearch - index mapping for 003 control-number-identifier is twice in mappings.yaml
Product: Koha Reporter: Caroline Cyr La Rose <caroline.cyr-la-rose>
Component: Searching - ElasticsearchAssignee: Caroline Cyr La Rose <caroline.cyr-la-rose>
Status: CLOSED FIXED QA Contact: Katrin Fischer <katrin.fischer>
Severity: minor    
Priority: P5 - low CC: david, fridolin.somers, lucas
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.11.00
Bug Depends on: 28830    
Bug Blocks:    
Attachments: Bug 31537: Elasticsearch - index mapping for 003 control-number-identifier is twice in mappings.yaml
Bug 31537: Elasticsearch - index mapping for 003 control-number-identifier is twice in mappings.yaml
Bug 31537: Elasticsearch - index mapping for 003 control-number-identifier is twice in mappings.yaml

Description Caroline Cyr La Rose 2022-09-08 15:51:57 UTC
Hi all!

I'm not sure if it's for a specific purpose, but the index mapping for 003 control-number-identifier was added twice in the mappings.yaml file.

In Bug 28830 and Bug 11175.

If it's not necessary that it be there twice, I propose we remove it.
Comment 1 Caroline Cyr La Rose 2022-09-08 16:13:14 UTC
Created attachment 140351 [details] [review]
Bug 31537: Elasticsearch - index mapping for 003 control-number-identifier is twice in mappings.yaml

This patch removes one of the two mappings for the 003 field to the
control-number-identifier index (for MARC21).

To test:
1) Apply patch
2) reindex with mappings reset
3) try to search for cni:code (for example cni:OSt)
--> it should return the desired results
4) try to search for control-number-identifier:code (for example
control-number-identifier:OSt)
--> it should return the desired results
5) Optionally, try the test plan in Bug 11175 to make sure it still
works
Comment 2 Caroline Cyr La Rose 2022-09-08 16:14:16 UTC
(In reply to Caroline Cyr La Rose from comment #0)
 
> If it's not necessary that it be there twice, I propose we remove it.

I mean, remove one of the two!
Comment 3 David Nind 2022-09-08 20:37:38 UTC
Created attachment 140355 [details] [review]
Bug 31537: Elasticsearch - index mapping for 003 control-number-identifier is twice in mappings.yaml

This patch removes one of the two mappings for the 003 field to the
control-number-identifier index (for MARC21).

To test:
1) Apply patch
2) reindex with mappings reset
3) try to search for cni:code (for example cni:OSt)
--> it should return the desired results
4) try to search for control-number-identifier:code (for example
control-number-identifier:OSt)
--> it should return the desired results
5) Optionally, try the test plan in Bug 11175 to make sure it still
works

Signed-off-by: David Nind <david@davidnind.com>
Comment 4 David Nind 2022-09-08 20:38:48 UTC
Testing notes (using koha-testing-docker):

- Followed the test plan, but didn't do optional step 5.
Comment 5 Katrin Fischer 2022-09-11 13:30:45 UTC
Created attachment 140398 [details] [review]
Bug 31537: Elasticsearch - index mapping for 003 control-number-identifier is twice in mappings.yaml

This patch removes one of the two mappings for the 003 field to the
control-number-identifier index (for MARC21).

To test:
1) Apply patch
2) reindex with mappings reset
3) try to search for cni:code (for example cni:OSt)
--> it should return the desired results
4) try to search for control-number-identifier:code (for example
control-number-identifier:OSt)
--> it should return the desired results
5) Optionally, try the test plan in Bug 11175 to make sure it still
works

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 6 Katrin Fischer 2022-09-11 13:35:20 UTC
Stared at this quite a while, wondering if one would be the definition for authorities - but it isn't, just a double up.
Comment 7 Caroline Cyr La Rose 2022-09-12 12:11:25 UTC
(In reply to Katrin Fischer from comment #6)
> Stared at this quite a while, wondering if one would be the definition for
> authorities - but it isn't, just a double up.

Yeah, me too!
Comment 8 Tomás Cohen Arazi 2022-09-12 18:37:29 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!