[Bug 19575] New: Use canonical field names and resolve aliased fields
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 Bug ID: 19575 Summary: Use canonical field names and resolve aliased fields Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: major Priority: P5 - low Component: Searching - Elasticsearch Assignee: koha-bugs@lists.koha-community.org Reporter: glasklas@gmail.com The current elastic search fields seems to be a mix between zebra aliases, field names, some duplicates and new fields. This causes issues with sorting in UI and hard-coded search-links in XSL-templates for example. I have attempted to clean things up a bit, which resolves many of these issues. I might not have the time to do so today, but will attempt to find and mark all current issues resolved by this fix. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #1 from David Gustafsson <glasklas@gmail.com> --- Created attachment 68914 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=68914&action=edit Bug 19575: Use canonical field names and resolve aliased fields Adjust elastic search mappings to more closely match Zebra equivalents resolving serveral issues with coded Zebra searches in templates, and sorting of search results in UI. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #2 from David Gustafsson <glasklas@gmail.com> --- The following issue should be resolved with this patch applied: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19485 But in addition to title-series, most of the other broken search links should also work. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #3 from David Gustafsson <glasklas@gmail.com> --- Think I have missed a few places (facets for example) where field names are hard coded and needs to be changes. So no point in trying out patch in it's current state until these things are fixed. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 David Gustafsson <glasklas@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #68914|0 |1 is obsolete| | --- Comment #4 from David Gustafsson <glasklas@gmail.com> --- Created attachment 69140 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=69140&action=edit Bug 19575: Use canonical field names and resolve aliased fields Adjust elastic search mappings to more closely match Zebra equivalents resolving serveral issues with coded Zebra searches in templates, and sorting of search results in UI. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 David Gustafsson <glasklas@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #69140|0 |1 is obsolete| | --- Comment #5 from David Gustafsson <glasklas@gmail.com> --- Created attachment 69153 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=69153&action=edit Bug 19575: Use canonical field names and resolve aliased fields Adjust elastic search mappings to more closely match Zebra equivalents resolving serveral issues with coded Zebra searches in templates, and sorting of search results in UI. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #6 from David Gustafsson <glasklas@gmail.com> --- Now most (hopefully all) issues (primarily with facets) should be sorted out. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 David Gustafsson <glasklas@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |glasklas@gmail.com |ity.org | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #7 from David Gustafsson <glasklas@gmail.com> --- Think I have been looking at the Zebra-mapping configuration in the wrong place (this old config, not biblio-koha-indexdefs.xml). I will go through the mapping changes one more time using this as reference instead. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 David Bourgault <david.bourgault@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david.bourgault@inlibro.com --- Comment #8 from David Bourgault <david.bourgault@inlibro.com> --- *** Bug 19485 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 David Gustafsson <glasklas@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #69153|0 |1 is obsolete| | --- Comment #9 from David Gustafsson <glasklas@gmail.com> --- Created attachment 69306 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=69306&action=edit Bug 19575: Use canonical field names and resolve aliased fields Adjust elastic search mappings to more closely match Zebra equivalents resolving serveral issues with coded Zebra searches in templates, and sorting of search results in UI. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #10 from David Gustafsson <glasklas@gmail.com> --- Wrote a script to extract mappings from biblio-koha-indexdefs.xml and convert to mappings.yaml, left the fields with existing mapping-targets as they are (even though discovered several discrepancies with the Zebra mappings) and mostly just added the missing fields. Will now do more thorough local testing so will probably adjust this patch some more before ready to be reviewed. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 David Gustafsson <glasklas@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #69306|0 |1 is obsolete| | --- Comment #11 from David Gustafsson <glasklas@gmail.com> --- Created attachment 69314 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=69314&action=edit Bug 19575: Use canonical field names and resolve aliased fields Adjust elastic search mappings to more closely match Zebra equivalents resolving serveral issues with coded Zebra searches in templates, and sorting of search results in UI. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org, | |nick@bywatersolutions.com --- Comment #12 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Is this ready for signoff? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #13 from David Gustafsson <glasklas@gmail.com> --- Sorry, should have been more clear about that. Yes, this is ready for signoff. There is still some stuff I left out of this patch, like: - New mappings for other marc-flavours than marc21 extracted from biblio-koha-indexdefs.xml - Correction for some existing mappings (I think some offsets are off by one for example) - New mappings and posssible corrections for authorities But if this get reviewed and committed I can open new bug-reports for those once I have time to further polish the extraction-script. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #14 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to David Gustafsson from comment #13)
But if this get reviewed and committed I can open new bug-reports for those once I have time to further polish the extraction-script.
Can you share the script? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #15 from David Gustafsson <glasklas@gmail.com> --- Yes, I was thinking to do so, though it is only a quick and dirty script in Ruby (should perhaps be re-written in perl if to be included in Koha-repo), and though would clean it up just a little bit more, remove some hard-coded stuff, add some simple command line options etc. But will post a link to git-repo with said script once removed the worst ugliness. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #16 from David Gustafsson <glasklas@gmail.com> --- https://github.com/ub-digit/koha-indexdefs-to-mappings-yaml -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 David Bourgault <david.bourgault@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 David Bourgault <david.bourgault@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Patch doesn't apply --- Comment #17 from David Bourgault <david.bourgault@inlibro.com> --- Patch fails to apply; conflict on file mappings.yaml. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 David Gustafsson <glasklas@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #69314|0 |1 is obsolete| | --- Comment #18 from David Gustafsson <glasklas@gmail.com> --- Created attachment 69479 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=69479&action=edit Bug 19575: Use canonical field names and resolve aliased fields Adjust elastic search mappings to more closely match Zebra equivalents resolving serveral issues with coded Zebra searches in templates, and sorting of search results in UI. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #19 from David Gustafsson <glasklas@gmail.com> --- Ok! Rebased against master. There was a commit in between setting the "sort" for serveral fields, those changes should now be merged in. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #20 from David Gustafsson <glasklas@gmail.com> --- Reviewing the commit-diff once again, I think I made an error in the merge. Will upload again. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 David Gustafsson <glasklas@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #69479|0 |1 is obsolete| | --- Comment #21 from David Gustafsson <glasklas@gmail.com> --- Created attachment 69480 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=69480&action=edit Bug 19575: Use canonical field names and resolve aliased fields Adjust elastic search mappings to more closely match Zebra equivalents resolving serveral issues with coded Zebra searches in templates, and sorting of search results in UI. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #22 from David Gustafsson <glasklas@gmail.com> --- Think git auto-merged some stuff incorrectly, but this should now be sorted out. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 David Gustafsson <glasklas@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #69480|0 |1 is obsolete| | --- Comment #23 from David Gustafsson <glasklas@gmail.com> --- Created attachment 69507 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=69507&action=edit Bug 19575: Use canonical field names and resolve aliased fields Adjust elastic search mappings to more closely match Zebra equivalents resolving serveral issues with coded Zebra searches in templates, and sorting of search results in UI. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #24 from David Gustafsson <glasklas@gmail.com> --- Field name 'Date/time-last-modified' does not work with elastic since "/" will create subfields, koha will also not tokanize this correctly, changed this (back) to 'Date-time-last-modified'. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #25 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to David Gustafsson from comment #22)
Think git auto-merged some stuff incorrectly, but this should now be sorted out.
So, ready to be signed off? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #26 from David Gustafsson <glasklas@gmail.com> --- Yes should be ready for sign off, have discovered no more issues since the most recent patch. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #27 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to David Gustafsson from comment #26)
Yes should be ready for sign off, have discovered no more issues since the most recent patch.
The good way to tell other people that your patch is ready to be tested is to change the status of the bug report from "Patch doesn't apply" to "Needs Signoff" -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #28 from David Gustafsson <glasklas@gmail.com> --- Aha, I looked for a status drop down but manage to miss it since it wasn't a drop down. :) Will fix. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 David Gustafsson <glasklas@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #29 from David Gustafsson <glasklas@gmail.com> --- And, now I saw there was a dropdown, but below the comment area. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #30 from David Gustafsson <glasklas@gmail.com> --- Just a caveat, just discovered that some field names hard coded in xsl-templates have names that differer in case from mappings.yaml. (control-number for example). Zebra has case-insensitive field names, but this will cause problems with elasticsearch. So this patch, while correcting some links, might also break some that worked before. I'm planning on writing a fix to make Elasticseach field names non case sensitive, but until that issue is resolved this patch might causee issues. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 David Gustafsson <glasklas@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #69507|0 |1 is obsolete| | --- Comment #31 from David Gustafsson <glasklas@gmail.com> --- Created attachment 70494 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=70494&action=edit Bug 19575: Use canonical field names and resolve aliased fields Adjust elastic search mappings to more closely match Zebra equivalents resolving serveral issues with coded Zebra searches in templates and sorting of search results in UI. Also make field names in search strings case insensitive to accept case variations in template links and user input. Sponsored-by: Gothenburg University Library -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #32 from David Gustafsson <glasklas@gmail.com> --- Case insensitive field names in searches is now fixed. A few changes I made could use some extra motivation/explanation: # sub _convert_index_strings_freeform() (line 685): changed from: sub _convert_index_strings_freeform { my ( $self, $search ) = @_; while ( my ( $zeb, $es ) = each %index_field_convert ) { $search =~ s/\b$zeb(?:,[\w\-]*)?:/$es:/g; } return $search; } to: my $field_name_pattern = '[\w\-]+'; my $multi_field_pattern = "(?:\\.$field_name_pattern)*"; ... sub _convert_index_strings_freeform { my ( $self, $search ) = @_; $search =~ s/($field_name_pattern)(?:,[\w-]*)?($multi_field_pattern):/\L$1\E$2:/og; $search =~ s/($field_name_pattern)($multi_field_pattern):/(exists $index_field_convert{$1} ? $index_field_convert{$1} : $1)."$2:"/oge; return $search; } (Excluding comments) With new regexps for lower-casing field names etc there is a lot of duplication for things like field names, possible multiple/subfields etc, so created some variables for components that are often reused to prevent some pitfalls in possible future refactoring. I'm not sure it really matters performance wise, but also replaced the alias replacement code with a more efficient code since the %index_field_convert hash is now much larger than before. Also, the regexp in sub _truncate_terms() has been changed to also use $field_name_pattern and $multi_field_pattern. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 David Gustafsson <glasklas@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #70494|0 |1 is obsolete| | --- Comment #33 from David Gustafsson <glasklas@gmail.com> --- Created attachment 70495 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=70495&action=edit Bug 19575: Use canonical field names and resolve aliased fields Adjust elastic search mappings to more closely match Zebra equivalents resolving serveral issues with coded Zebra searches in templates and sorting of search results in UI. Also make field names in search strings case insensitive to accept case variations in template links and user input. Sponsored-by: Gothenburg University Library -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #34 from David Gustafsson <glasklas@gmail.com> --- Found some more places where hard coded fields needed to be changed to lower-case. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #35 from David Gustafsson <glasklas@gmail.com> --- Here is a github-diff that might be easier on the eyes: https://github.com/ub-digit/Koha/commit/8be850d2cdc93e5d121afa19c5eed1e1cc68... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 David Gustafsson <glasklas@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #70495|0 |1 is obsolete| | --- Comment #36 from David Gustafsson <glasklas@gmail.com> --- Created attachment 70558 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=70558&action=edit Bug 19575: Use canonical field names and resolve aliased fields Adjust elastic search mappings to more closely match Zebra equivalents resolving serveral issues with coded Zebra searches in templates and sorting of search results in UI. Also make field names in search strings case insensitive to accept case variations in template links and user input. Sponsored-by: Gothenburg University Library -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #37 from David Gustafsson <glasklas@gmail.com> --- Found one (hopefully) last place that needed case-adjustment. New diff: https://github.com/ub-digit/Koha/commit/a6fda51b59c65c2459d460fd374377b56b5f... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 David Gustafsson <glasklas@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #70558|0 |1 is obsolete| | --- Comment #38 from David Gustafsson <glasklas@gmail.com> --- Created attachment 71090 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=71090&action=edit Bug 19575: Use canonical field names and resolve aliased fields Adjust elastic search mappings to more closely match Zebra equivalents resolving serveral issues with coded Zebra searches in templates and sorting of search results in UI. Also make field names in search strings case insensitive to accept case variations in template links and user input. Sponsored-by: Gothenburg University Library -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #39 from David Gustafsson <glasklas@gmail.com> --- Found one more hard coded field value in authorities search that needed lower-casing. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 David Gustafsson <glasklas@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #71090|0 |1 is obsolete| | --- Comment #40 from David Gustafsson <glasklas@gmail.com> --- Created attachment 71112 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=71112&action=edit Bug 19575: Use canonical field names and resolve aliased fields Adjust elastic search mappings to more closely match Zebra equivalents resolving serveral issues with coded Zebra searches in templates and sorting of search results in UI. Also make field names in search strings case insensitive to accept case variations in template links and user input. Sponsored-by: Gothenburg University Library -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #41 from David Gustafsson <glasklas@gmail.com> --- Fixed hard coded field name in Koha/SearchEngine/ElasticSearch/Search.pm ('au' to 'authority-number') -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #42 from David Gustafsson <glasklas@gmail.com> --- *('an' to 'authority-number') -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 David Gustafsson <glasklas@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #71112|0 |1 is obsolete| | --- Comment #43 from David Gustafsson <glasklas@gmail.com> --- Created attachment 71966 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=71966&action=edit Bug 19575: Use canonical field names and resolve aliased fields Adjust elastic search mappings to more closely match Zebra equivalents resolving serveral issues with coded Zebra searches in templates and sorting of search results in UI. Also make field names in search strings case insensitive to accept case variations in template links and user input. Sponsored-by: Gothenburg University Library -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #44 from David Gustafsson <glasklas@gmail.com> --- Removed incorrect alias/field name conversions (ctype => "content-type"), and some aliases with identical source and target values. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #71966|0 |1 is obsolete| | --- Comment #45 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 72673 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=72673&action=edit Bug 19575: Use canonical field names and resolve aliased fields Adjust elastic search mappings to more closely match Zebra equivalents resolving serveral issues with coded Zebra searches in templates and sorting of search results in UI. Also make field names in search strings case insensitive to accept case variations in template links and user input. Sponsored-by: Gothenburg University Library Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl Summary|Use canonical field names |ES: Use canonical field |and resolve aliased fields |names and resolve aliased | |fields -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|ES: Use canonical field |Use canonical field names |names and resolve aliased |and resolve aliased fields |fields | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 David Gustafsson <glasklas@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #72673|0 |1 is obsolete| | --- Comment #46 from David Gustafsson <glasklas@gmail.com> --- Created attachment 75115 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=75115&action=edit Bug 19575: Use canonical field names and resolve aliased fields Adjust elastic search mappings to more closely match Zebra equivalents resolving serveral issues with coded Zebra searches in templates and sorting of search results in UI. Also make field names in search strings case insensitive to accept case variations in template links and user input. Sponsored-by: Gothenburg University Library Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #47 from David Gustafsson <glasklas@gmail.com> --- Rebased against master. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |julian.maurice@biblibre.com Status|Signed Off |Patch doesn't apply --- Comment #48 from Julian Maurice <julian.maurice@biblibre.com> --- Sorry David, but the patch does not apply on master. Small conflict on mappings.yaml. Could you rebase it ? Also, could you provide a test plan ? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #49 from David Gustafsson <glasklas@gmail.com> --- Will fix this. Test plan is a litte bit tricky since this corrects a lot of small stuff. But will try to backtrack to list most of what is fixed. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 David Gustafsson <glasklas@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #75115|0 |1 is obsolete| | --- Comment #50 from David Gustafsson <glasklas@gmail.com> --- Created attachment 81297 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=81297&action=edit Bug 19575: Use canonical field names and resolve aliased fields Adjust elastic search mappings to more closely match Zebra equivalents resolving serveral issues with coded Zebra searches in templates and sorting of search results in UI. Also make field names in search strings case insensitive to accept case variations in template links and user input. To test: 1) Go to a biblio detail page 2) Click a link under "Publisher" or "Provider" 3) This link should yield no search results 4) Search for "ISBN:x" where x is a valid isbn. 5) The search should produce no results. 6) Apply patch 7) Go to a biblio detail page and click "Publisher" or "Provider" again 8) The link should no produce results 9) Search for "ISBN:x" again 10) The search should now produce results Sponsored-by: Gothenburg University Library Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 David Gustafsson <glasklas@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #81297|0 |1 is obsolete| | --- Comment #51 from David Gustafsson <glasklas@gmail.com> --- Created attachment 81299 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=81299&action=edit Bug 19575: Use canonical field names and resolve aliased fields Adjust elastic search mappings to more closely match Zebra equivalents resolving serveral issues with coded Zebra searches in templates and sorting of search results in UI. Also make field names in search strings case insensitive to accept case variations in template links and user input. To test: 1) Go to a biblio detail page 2) Click a link under "Publisher" or "Provider" 3) This link should yield no search results 4) Search for "ISBN:x" where x is a valid isbn. 5) The search should yield no results. 6) Apply patch 7) Go to a biblio detail page and click "Publisher" or "Provider" again 8) The link should now yield search results 9) Search for "ISBN:x" again 10) The search should now yield search results Sponsored-by: Gothenburg University Library Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 David Gustafsson <glasklas@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #81299|0 |1 is obsolete| | --- Comment #52 from David Gustafsson <glasklas@gmail.com> --- Created attachment 81303 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=81303&action=edit Bug 19575: Use canonical field names and resolve aliased fields Adjust elastic search mappings to more closely match Zebra equivalents resolving serveral issues with coded Zebra searches in templates and sorting of search results in UI. Also make field names in search strings case insensitive to accept case variations in template links and user input. To test: 1) Go to a biblio detail page 2) Click a link under "Publisher" or "Provider" 3) This link should yield no search results 4) Search for "ISBN:x" where x is a valid isbn. 5) The search should yield no results. 6) Apply patch 7) Reset mappings 8) Perform a full reindexing 9) Go to a biblio detail page and click "Publisher" or "Provider" again 10) The link should now yield search results 11) Search for "ISBN:x" again 12) The search should now yield search results Sponsored-by: Gothenburg University Library Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 David Gustafsson <glasklas@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #81303|0 |1 is obsolete| | --- Comment #53 from David Gustafsson <glasklas@gmail.com> --- Created attachment 81304 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=81304&action=edit Bug 19575: Use canonical field names and resolve aliased fields Adjust elastic search mappings to more closely match Zebra equivalents resolving serveral issues with coded Zebra searches in templates and sorting of search results in UI. Also make field names in search strings case insensitive to accept case variations in template links and user input. To test: 1) Go to a biblio detail page 2) Click a link under "Publisher" or "Provider" 3) This link should yield no search results 4) Search for "ISBN:x" where x is a valid isbn. 5) The search should yield no results. 6) Apply patch 7) Reset mappings 8) Perform a full reindexing 9) Go to a biblio detail page and click "Publisher" or "Provider" again 10) The link should now yield search results 11) Search for "ISBN:x" again 12) The search should now yield search results 13) Also try searching for "isbn:x" and "Isbn:x" 14) This should also work and yield search results Sponsored-by: Gothenburg University Library Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de Status|Patch doesn't apply |Signed Off --- Comment #54 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Patch applies, resetting status. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 David Gustafsson <glasklas@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #81304|0 |1 is obsolete| | --- Comment #55 from David Gustafsson <glasklas@gmail.com> --- Created attachment 82794 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=82794&action=edit Bug 19575: Use canonical field names and resolve aliased fields Adjust elastic search mappings to more closely match Zebra equivalents resolving serveral issues with coded Zebra searches in templates and sorting of search results in UI. Also make field names in search strings case insensitive to accept case variations in template links and user input. Sponsored-by: Gothenburg University Library Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #56 from David Gustafsson <glasklas@gmail.com> --- Rebase against master. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com --- Comment #57 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- This all looks sane to me.. but I'm going to raise it to our resident ES expert and ask for his SO as a PQA.. calling Ere -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ere.maijala@helsinki.fi -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 Ere Maijala <ere.maijala@helsinki.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #82794|0 |1 is obsolete| | --- Comment #58 from Ere Maijala <ere.maijala@helsinki.fi> --- Created attachment 83704 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=83704&action=edit Bug 19575: Use canonical field names and resolve aliased fields Adjust elastic search mappings to more closely match Zebra equivalents resolving serveral issues with coded Zebra searches in templates and sorting of search results in UI. Also make field names in search strings case insensitive to accept case variations in template links and user input. Sponsored-by: Gothenburg University Library Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Ere Maijala <ere.maijala@helsinki.fi> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #59 from Ere Maijala <ere.maijala@helsinki.fi> --- Awesome, thanks David. This was actually on my list of things to work on when time permits, and it had been bugging me. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 Ere Maijala <ere.maijala@helsinki.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |frank.hansen@ub.lu.se --- Comment #60 from Ere Maijala <ere.maijala@helsinki.fi> --- *** Bug 21793 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #83704|0 |1 is obsolete| | --- Comment #61 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 83710 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=83710&action=edit Bug 19575: Use canonical field names and resolve aliased fields Adjust elastic search mappings to more closely match Zebra equivalents resolving serveral issues with coded Zebra searches in templates and sorting of search results in UI. Also make field names in search strings case insensitive to accept case variations in template links and user input. Sponsored-by: Gothenburg University Library Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Ere Maijala <ere.maijala@helsinki.fi> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA --- Comment #62 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Fixed a single whitespace error that was introduced. Passing QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact| |ere.maijala@helsinki.fi -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Failed QA --- Comment #63 from Nick Clemens <nick@bywatersolutions.com> --- (In reply to Martin Renvoize from comment #62)
Fixed a single whitespace error that was introduced.
Passing QA
Tests are failing with these patches: prove -v t/db_dependent/SearchEnginge/ElasticSearch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #64 from Ere Maijala <ere.maijala@helsinki.fi> --- David, will you be able to address the test issues? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=22229 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #65 from David Gustafsson <glasklas@gmail.com> --- Unfortunately I have have been a little bit too busy lately to have a look at this, but hope will have the time to do so some time next week. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #83710|0 |1 is obsolete| | --- Comment #66 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 85029 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=85029&action=edit Bug 19575: Use canonical field names and resolve aliased fields Adjust elastic search mappings to more closely match Zebra equivalents resolving serveral issues with coded Zebra searches in templates and sorting of search results in UI. Also make field names in search strings case insensitive to accept case variations in template links and user input. Sponsored-by: Gothenburg University Library Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Ere Maijala <ere.maijala@helsinki.fi> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #67 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 85030 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=85030&action=edit Bug 19575: Rebase and fix tests This patch lower cases the sort by fields to normalize checking them and adjusts some existing tests to meet the new expectations. The regex for splitting terms has been moved into a subroutine so that adjustment was made -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #68 from Nick Clemens <nick@bywatersolutions.com> --- Rebased and updated, I think in spirit of original set - set to Signed off, would like another QA run and Ere's okay -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #69 from Nick Clemens <nick@bywatersolutions.com> --- Extra note: I found that indexes like 'se' and 'an' were not searchable - no results were returned from faceting or searchign like "se:pengiun" changing to title-series (or even 'ser' in testing) seemed to work -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #70 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Nick Clemens from comment #69)
Extra note: I found that indexes like 'se' and 'an' were not searchable - no results were returned from faceting or searchign like "se:pengiun" changing to title-series (or even 'ser' in testing) seemed to work
an is used in the XSLT templates, sounds like an issue? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #71 from David Gustafsson <glasklas@gmail.com> --- (In reply to Nick Clemens from comment #67)
Created attachment 85030 [details] [review] Bug 19575: Rebase and fix tests
This patch lower cases the sort by fields to normalize checking them and adjusts some existing tests to meet the new expectations.
The regex for splitting terms has been moved into a subroutine so that adjustment was made
Thanks for adjusting the tests. The regexp was put outside of the subroutine on purpose though, to avoid recompilation on each call. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #85030|0 |1 is obsolete| | --- Comment #72 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 85062 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=85062&action=edit Bug 19575: Rebase and fix tests This patch lower cases the sort by fields to normalize checking them and adjusts some existing tests to meet the new expectations. The regex for splitting terms has been moved into a subroutine so that adjustment was made -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #73 from Nick Clemens <nick@bywatersolutions.com> --- (In reply to Katrin Fischer from comment #70)
(In reply to Nick Clemens from comment #69)
Extra note: I found that indexes like 'se' and 'an' were not searchable - no results were returned from faceting or searchign like "se:pengiun" changing to title-series (or even 'ser' in testing) seemed to work
an is used in the XSLT templates, sounds like an issue?
Filed on a new bug 20388 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #74 from Nick Clemens <nick@bywatersolutions.com> --- (In reply to David Gustafsson from comment #71)
(In reply to Nick Clemens from comment #67)
Created attachment 85030 [details] [review] [review] Bug 19575: Rebase and fix tests
This patch lower cases the sort by fields to normalize checking them and adjusts some existing tests to meet the new expectations.
The regex for splitting terms has been moved into a subroutine so that adjustment was made
Thanks for adjusting the tests. The regexp was put outside of the subroutine on purpose though, to avoid recompilation on each call.
Moved back outside, thanks -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #75 from David Gustafsson <glasklas@gmail.com> --- (In reply to Nick Clemens from comment #69)
Extra note: I found that indexes like 'se' and 'an' were not searchable - no results were returned from faceting or searchign like "se:pengiun" changing to title-series (or even 'ser' in testing) seemed to work
About this issue and the "an" alias, this does not work with this patch applied? The alias seems to exist in the %index_field_convert map, and is expanded as far as I can tell. But could look into this if not working. I got a little bit confused since bug 20388 says "'se' is fixed in bug 19575". :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #76 from David Gustafsson <glasklas@gmail.com> --- Oops, bug 22325 I mean, perhaps you linked to the wrong bug number in the previous comment? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #77 from David Gustafsson <glasklas@gmail.com> --- Could the cause be that the value of an: is unquoted in clause where UseAuthoritiesForTracings is set in the excerpt below (koha-tmpl/intranet-tmpl/prog/en/xslt/NORMARCslim2intranetResults.xsl line 308): <xsl:choose> <xsl:when test="marc:datafield[@tag=100] or marc:datafield[@tag=110] or marc:datafield[@tag=111] or marc:datafield[@tag=700] or marc:datafield[@tag=710] or marc:datafield[@tag=711]"> <p class="author">av <xsl:for-each select="marc:datafield[(@tag=100 or @tag=700) and @ind1!='z']"> <a> <xsl:choose> <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'"> <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute> </xsl:when> <xsl:otherwise> <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=au:"<xsl:value-of select="str:encode-uri(marc:subfield[@code='a'], true())"/>"</xsl:attribute> </xsl:otherwise> </xsl:choose> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #78 from David Gustafsson <glasklas@gmail.com> --- (And in many other places). Should perhaps not matter though if "an" never contains whitespace. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #79 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 85105 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=85105&action=edit Bug 19575: Fix an search field -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #80 from Nick Clemens <nick@bywatersolutions.com> --- (In reply to David Gustafsson from comment #75)
(In reply to Nick Clemens from comment #69)
Extra note: I found that indexes like 'se' and 'an' were not searchable - no results were returned from faceting or searchign like "se:pengiun" changing to title-series (or even 'ser' in testing) seemed to work
About this issue and the "an" alias, this does not work with this patch applied? The alias seems to exist in the %index_field_convert map, and is expanded as far as I can tell. But could look into this if not working. I got a little bit confused since bug 20388 says "'se' is fixed in bug 19575". :)
Aha, it turns out an should work, but an was mapped to authority-number and koha-auth-number was mapped to authority-number - but koha-auth-number was the field name :-) Patch attached -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #81 from David Gustafsson <glasklas@gmail.com> --- Created attachment 85124 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=85124&action=edit Bug 19575: Keep authority-number as alias and fix query Keep authority-number as alias and change field name from alias to real field in hard coded Elasticsearch query -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #82 from David Gustafsson <glasklas@gmail.com> --- Ok! Since it was some time ago I don't really remember how to parse the Zebra field definitions anymore, but the authority-number entry looked a little bit strange and I might have made some a mistake regarding the format. I re-added authority-number as an alias, probably not needed but doesn't hurt. Also found an instance of authority-number being used in a hard coded Elasticsearch query. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #85029|0 |1 is obsolete| | --- Comment #83 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 85125 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=85125&action=edit Bug 19575: Use canonical field names and resolve aliased fields Adjust elastic search mappings to more closely match Zebra equivalents resolving serveral issues with coded Zebra searches in templates and sorting of search results in UI. Also make field names in search strings case insensitive to accept case variations in template links and user input. Sponsored-by: Gothenburg University Library Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Ere Maijala <ere.maijala@helsinki.fi> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #85062|0 |1 is obsolete| | --- Comment #84 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 85126 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=85126&action=edit Bug 19575: Rebase and fix tests This patch lower cases the sort by fields to normalize checking them and adjusts some existing tests to meet the new expectations. The regex for splitting terms has been moved into a subroutine so that adjustment was made Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #85105|0 |1 is obsolete| | --- Comment #85 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 85127 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=85127&action=edit Bug 19575: Fix an search field Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #85124|0 |1 is obsolete| | --- Comment #86 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 85128 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=85128&action=edit Bug 19575: Keep authority-number as alias and fix query Keep authority-number as alias and change field name from alias to real field in hard coded Elasticsearch query Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #87 from Nick Clemens <nick@bywatersolutions.com> --- *** Bug 22229 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #88 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 85178 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=85178&action=edit Bug 19575: (RM follow-up) Fix mapping typo Found with QA tools, simple fix -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #89 from Nick Clemens <nick@bywatersolutions.com> --- I looked at this today, but the update statement is a little confusing. Should we update a library's mappings in updates? or simply require that they reset mappings when upgrading? I am okay with updating, but it also seems some of the lines are unnecessary with the generic statement of lower casing at the top? Can you review and format the update using skeleton.perl? Or let me know if I missed something? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #90 from David Gustafsson <glasklas@gmail.com> --- Yes, the lowercase update statement is pretty pointless since the mixed case field names will be restored on reset. Field names are lower-cased in _foreach_mapping, so the case of field names in mappings.yaml (or database) does not really matter. If lower casing all field names the corresponding field names in mappings.yaml should also be lower cased. The field name renaming is probably still a good idea, so that a reset is not required. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #91 from David Gustafsson <glasklas@gmail.com> --- Created attachment 85247 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=85247&action=edit Bug 19575: Don't lower case fields in db and use update script instead of raw SQL -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #92 from Nick Clemens <nick@bywatersolutions.com> --- (In reply to David Gustafsson from comment #91)
Created attachment 85247 [details] [review] Bug 19575: Don't lower case fields in db and use update script instead of raw SQL
Hi David, Thanks for that update, I still see some lines I wonder about, the ones like: dbh->do( "UPDATE `search_field` SET `name` = 'isbn', `label` = 'isbn' WHERE `name` = 'isbn'" ); I don't see any change here - isbn is being renamed to isbn, there are a fair amount of lines like this in the update. The other ones like se being renamed title-series do make sense It seems we could trim this down a fair amount -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #93 from Nick Clemens <nick@bywatersolutions.com> --- (In reply to Nick Clemens from comment #92) Talked with Ere, he verified these make sense -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |This patchset makes some release notes| |changes to Elasticsearch | |mappings in the database. | |The changes alter existing | |indices and are intended to | |fix issues with the current | |mappings, however, if you | |have done customization of | |mappings you may want to | |back them up before | |upgrading. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #94 from Nick Clemens <nick@bywatersolutions.com> --- Awesome work all! Pushed to master for 19.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable --- Comment #95 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Pushed to 18.11.x for 18.11.04 I had a brief discussion regarding this one in IRC and we reached the consensus that we are both earlier enough in the cycle and the lifetime of the Elasticsearch use that it was a sensible one to backport even though it has further reaching effects than we would normally permit in a stable branch release. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |josef.moravec@gmail.com --- Comment #96 from Josef Moravec <josef.moravec@gmail.com> --- Why was su-geo facet field removed by this? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #97 from David Gustafsson <glasklas@gmail.com> --- That might have been a mistake. The mappings where generated from this script from Zebra mapping definitions: https://github.com/ub-digit/koha-indexdefs-to-mappings-yaml/blob/master/mapp... but su-geo is in the source mappings as far as I can see and should not have been removed. I also manually rebased mappings.yaml a couple of times after upstream changes, don't know if made some mistake there. Since I seems to have commented out the alias ('su-geo' => 'subject') in the patch, it seams like I expected the field to exist, so I probably did not remove it intentionally and it should be re-added. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #98 from David Gustafsson <glasklas@gmail.com> --- I had a look at the script again and now remembered it does not migrate zebra facets declared in biblio-koha-indexdefs.xml, that might be the reason it got dropped. The other facet fields are present in mappings.yaml though. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 Ere Maijala <ere.maijala@helsinki.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=22495 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #99 from Ere Maijala <ere.maijala@helsinki.fi> --- I filed bug 22495 for the su-geo fix. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #100 from Ere Maijala <ere.maijala@helsinki.fi> --- Looks to me like the original confusion might stem from the fact that queryparser.yaml defines su-geo as an alias for subject. I think that might be a mistake in queryparser.yaml. It was added in bug 9828 that improved UNIMARC support. I suspect there wasn't proper su-geo field in UNIMARC mappings, and the alias would make sense, but only for UNIMARC. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com --- Comment #101 from Lucas Gass <lucas@bywatersolutions.com> --- not backporting this to 18.05x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |22495 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22495 [Bug 22495] Restore su-geo field in Elasticsearch mappings -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |20390 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20390 [Bug 20390] Elasticsearch - Mappings for UNIMARC (updates existing) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 claire.hernandez@biblibre.com <claire.hernandez@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |claire.hernandez@biblibre.c | |om --- Comment #102 from claire.hernandez@biblibre.com <claire.hernandez@biblibre.com> --- I see this line: $dbh->do( "UPDATE `search_field` SET `name` = 'date-of-publication', `label` = 'date-of-publication' WHERE `name` = 'pubdate'" ); The name is changed in database, but in YAML file, I always have pubdate, this has not been modified. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #103 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to claire.hernandez@biblibre.com from comment #102)
I see this line: $dbh->do( "UPDATE `search_field` SET `name` = 'date-of-publication', `label` = 'date-of-publication' WHERE `name` = 'pubdate'" );
The name is changed in database, but in YAML file, I always have pubdate, this has not been modified.
Hi Claire, can you please open a new bug report and link to this one? It's already in a released version, so we need a fix on a new bug. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 --- Comment #104 from Ere Maijala <ere.maijala@helsinki.fi> --- Claire, the publication date mapping will be fixed in bug 22524. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 Ere Maijala <ere.maijala@helsinki.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=22524 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |22524 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22524 [Bug 22524] Elasticsearch - Date range in advanced search -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19575 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Stable |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org