[Koha-bugs] [Bug 24807] Add "year" type to improve sorting by publication date

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu May 7 18:27:43 CEST 2020


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24807

Nick Clemens <nick at bywatersolutions.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #103084|0                           |1
        is obsolete|                            |
 Attachment #103085|0                           |1
        is obsolete|                            |
 Attachment #103086|0                           |1
        is obsolete|                            |
 Attachment #103087|0                           |1
        is obsolete|                            |
 Attachment #103163|0                           |1
        is obsolete|                            |
 Attachment #103277|0                           |1
        is obsolete|                            |

--- Comment #22 from Nick Clemens <nick at bywatersolutions.com> ---
Created attachment 104525
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=104525&action=edit
Bug 24807: Add "year" type to improve sorting behaviour

Add a "year" search field type. Fields with this type will only
retain values that looks like years, so invalid values such as
whitespace or word characters will not be indexed.
This for instance improves the behaviour when sorting by
"date-of-publication". If all values are indexed, records with
junk data instead of valid years will appear first among the search
results, drowning out more relevant hits. If assigning this field
the "year" type these records will instead always appear last,
regarless of sort order.

To test:

1) Have at least two biblios, one with a valid year in 008 (pos 7-10)
and another with an invalid one ("uuuu" for example)
2) Perform a wildcard search (*) and sort results by publication date.
3) The record with invalid year of pulication in 008 should appear first
4) Apply patch and run database updates
5) Reindex ElasticSearch
6) Perform the same search as in 2)
7) The record with the invalid year should now appear last

Signed-off-by: Nick Clemens <nick at bywatersolutions.com>

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list