[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
Fri Jun 5 18:15:05 CEST 2020


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

--- Comment #30 from Nick Clemens <nick at bywatersolutions.com> ---
(In reply to Julian Maurice from comment #29)
> > return map { s/[u]/0/gr } ( $value =~ /[0-9u]{4}/g );
> 
> This line has some problems IMO:
> - It only considers years of 4 digits. I believe it is valid in MARC21 to
> write years with 3 digits or less, so it should be possible to index those
> values too.
> - In UNIMARC uncertain digits can be replaced by a blank (space) in some
> cases (100$a for instance :
> https://www.transition-bibliographique.fr/wp-content/uploads/2018/07/B100-6-
> 2010.pdf [in french, sorry])

>From what little I understand there, UNIMARC uses '#' as the unkown character?
or '#' translates to blank?

leading blanks should be preserved as 0? and trailing ranged as you say below?

> - Replacing the uncertain character by 0 can be problematic. 197u is not
> 1970. Ideally, searching for records published in 1975 should return records
> where publication date is "197u", right ? Elasticsearch has an integer_range
> data type that could be useful in this situation. What do you think ?

That is interesting, how does the range affect sorting? Might it still be
worthwhile to sort unknown/ranged dates either at start or end, so file the
sort value as either 1970 or 1979?

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


More information about the Koha-bugs mailing list