Bug 17169 - Add facets for ccode to elasticsearch
Summary: Add facets for ccode to elasticsearch
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Nick Clemens (kidclamp)
QA Contact: Testopia
URL:
Keywords:
Depends on: 18068
Blocks: 18235 18322
  Show dependency treegraph
 
Reported: 2016-08-23 15:25 UTC by Nick Clemens (kidclamp)
Modified: 2018-06-04 20:10 UTC (History)
6 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 17169 - Add a facet for ccode fields to ElasticSearch (4.83 KB, patch)
2016-10-11 09:06 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 17169: Add a facet for ccode fields to ElasticSearch (4.92 KB, patch)
2017-02-06 19:51 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 17169: (QA followup) Add NORMARC and UNIMARC definitions for CCODE (1.02 KB, patch)
2017-02-06 19:52 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 17679 - Use CCODE descriptions instead of codes (2.38 KB, patch)
2017-02-16 14:29 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 17679 - Use CCODE descriptions instead of codes (2.41 KB, patch)
2017-02-24 21:47 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 17169 - Use CCODE descriptions instead of codes (2.43 KB, patch)
2017-02-28 20:47 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 17169: Add a facet for ccode fields to ElasticSearch (4.96 KB, patch)
2017-03-07 18:35 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 17169: (QA followup) Add NORMARC and UNIMARC definitions for CCODE (1.09 KB, patch)
2017-03-07 18:36 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 17169 - Use CCODE descriptions instead of codes (2.45 KB, patch)
2017-03-07 18:36 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 (kidclamp) 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 (kidclamp) 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 (tcohen) 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 (tcohen) 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 (tcohen) 2017-02-06 19:53:34 UTC
Nick, can you file a new one for the material language?
Comment 6 Tomás Cohen Arazi (tcohen) 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 (kidclamp) 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 (kidclamp) 2017-02-24 21:47:18 UTC
Created attachment 60664 [details] [review]
Bug 17679 - Use CCODE descriptions instead of codes
Comment 11 Nick Clemens (kidclamp) 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 (kidclamp) 2017-02-28 20:47:22 UTC
Created attachment 60741 [details] [review]
Bug 17169 - Use CCODE descriptions instead of codes
Comment 14 Nick Clemens (kidclamp) 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...