Bug 17169

Summary: Add facets for ccode to elasticsearch
Product: Koha Reporter: Nick Clemens <nick>
Component: SearchingAssignee: Nick Clemens <nick>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: brendan, dcook, jonathan.druart, katrin.fischer, marjorie.barry-vila, nick, tomascohen
Version: master   
Hardware: All   
OS: All   
Change sponsored?: Sponsored Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 18068    
Bug Blocks: 18235, 18322    
Attachments: Bug 17169 - Add a facet for ccode fields to ElasticSearch
Bug 17169: Add a facet for ccode fields to ElasticSearch
Bug 17169: (QA followup) Add NORMARC and UNIMARC definitions for CCODE
Bug 17679 - Use CCODE descriptions instead of codes
Bug 17679 - Use CCODE descriptions instead of codes
Bug 17169 - Use CCODE descriptions instead of codes
Bug 17169: Add a facet for ccode fields to ElasticSearch
Bug 17169: (QA followup) Add NORMARC and UNIMARC definitions for CCODE
Bug 17169 - Use CCODE descriptions instead of codes

Description Nick Clemens 2016-08-23 15:25:26 UTC
Work to be done :

* Add collection code facet to limit results using CCODE values
* Add language facet to limit results based on the material language
Comment 1 Katrin Fischer 2016-08-23 21:03:24 UTC
+1!
Comment 2 Nick Clemens 2016-10-11 09:06:19 UTC
Created attachment 56141 [details] [review]
Bug 17169 - Add a facet for ccode fields to ElasticSearch

To test:
1 - Apply patch
2 - Backup your db
3 - Drop and create a new db to ensure your mappings are refreshed from
the patch
4 - add some titles with items with collection codes
5 - search and see collection code facets
6 - sign off

Work to be done:
1 - Replace codes with descriptions
Comment 3 Tomás Cohen Arazi 2017-02-06 19:51:55 UTC
Created attachment 59946 [details] [review]
Bug 17169: Add a facet for ccode fields to ElasticSearch

To test:
1 - Apply patch
2 - Backup your db
3 - Drop and create a new db to ensure your mappings are refreshed from
the patch
4 - add some titles with items with collection codes
5 - search and see collection code facets
6 - sign off

Work to be done:
1 - Replace codes with descriptions

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 4 Tomás Cohen Arazi 2017-02-06 19:52:03 UTC
Created attachment 59947 [details] [review]
Bug 17169: (QA followup) Add NORMARC and UNIMARC definitions for CCODE

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 5 Tomás Cohen Arazi 2017-02-06 19:53:34 UTC
Nick, can you file a new one for the material language?
Comment 6 Tomás Cohen Arazi 2017-02-06 19:55:00 UTC
I wrongly applied it on top of my patch for bug 18068, will make it dependent on it... If needed, I can do the work of rebasing the other way around...
Comment 7 Jonathan Druart 2017-02-16 11:52:33 UTC
> Work to be done:
> 1 - Replace codes with descriptions

I think this is mandatory to make it in
Comment 8 Nick Clemens 2017-02-16 14:29:44 UTC
Created attachment 60354 [details] [review]
Bug 17679 - Use CCODE descriptions instead of codes
Comment 9 Jonathan Druart 2017-02-20 12:39:10 UTC
Nick,
My DB is dirty and I have Collection values that do not have CCODE AV related.
I think we should display the code if there is no lib, something like
SET facet.facet_label_value = AuthorisedValues.GetByCode('CCODE',facet.facet_label_value,0) || facet.facet_label_value
What do you think?

Otherwise there are empty li created.
Comment 10 Nick Clemens 2017-02-24 21:47:18 UTC
Created attachment 60664 [details] [review]
Bug 17679 - Use CCODE descriptions instead of codes
Comment 11 Nick Clemens 2017-02-24 21:48:30 UTC
Seems reasonable to me - I think I assumed the plugin returned the code if it didn't match. I would almost prefer that, I can't think of many situations where we don't want to return it, but it seems to be used in lots of places right now and I don't want to break anything
Comment 12 Jonathan Druart 2017-02-27 08:25:37 UTC
(In reply to Nick Clemens from comment #11)
> Seems reasonable to me - I think I assumed the plugin returned the code if
> it didn't match. I would almost prefer that, I can't think of many
> situations where we don't want to return it, but it seems to be used in lots
> of places right now and I don't want to break anything

So? You did not implement what I suggested, it would fix the issue without breaking anything.
Comment 13 Nick Clemens 2017-02-28 20:47:22 UTC
Created attachment 60741 [details] [review]
Bug 17169 - Use CCODE descriptions instead of codes
Comment 14 Nick Clemens 2017-02-28 20:48:17 UTC
(In reply to Jonathan Druart from comment #12)
> So? You did not implement what I suggested, it would fix the issue without
> breaking anything.

I did, I just missed an add for the opac too :-)

last patch should include your suggestion
Comment 15 Jonathan Druart 2017-03-07 18:35:58 UTC
Created attachment 60890 [details] [review]
Bug 17169: Add a facet for ccode fields to ElasticSearch

To test:
1 - Apply patch
2 - Backup your db
3 - Drop and create a new db to ensure your mappings are refreshed from
the patch
4 - add some titles with items with collection codes
5 - search and see collection code facets
6 - sign off

Work to be done:
1 - Replace codes with descriptions

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 16 Jonathan Druart 2017-03-07 18:36:04 UTC
Created attachment 60891 [details] [review]
Bug 17169: (QA followup) Add NORMARC and UNIMARC definitions for CCODE

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 17 Jonathan Druart 2017-03-07 18:36:09 UTC
Created attachment 60892 [details] [review]
Bug 17169 - Use CCODE descriptions instead of codes

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 18 Brendan Gallagher 2017-03-23 10:27:47 UTC
Pushed to Master - Should be in the 17.05 Release.  Thanks
Comment 19 Katrin Fischer 2017-03-26 20:48:22 UTC
This won't get ported back to 16.11.x as it is an enhancement.
Comment 20 David Cook 2017-10-04 06:45:09 UTC
I actually have some zebra code for this that I could contribute at some point as well...
Comment 21 David Cook 2017-10-04 06:47:07 UTC
(In reply to David Cook from comment #20)
> I actually have some zebra code for this that I could contribute at some
> point as well...

Ah for non-native facets in Zebra...