Multi-Category Search "composer name" broken?

Use this forum for HELP at Choral Public Domain Library as well as FEEDBACK
Post Reply
maiamcc
Posts: 4
Joined: 22 Dec 2019 18:23

Multi-Category Search "composer name" broken?

Post by maiamcc »

Hi folks,

Was trying to find some scores this morning and it seems that the Multi-Category Search "work title/composer name" field isn't working as expected. For example, a search for ALL SATB scores matching "Byrd" turns up precisely one result (Jeg bærer med smil min byrde).

I've played around with it a bit, and my best guess is that whatever goes in the "work title/composer name" box is being searched for as all lowercase, e.g.:
  • a search for "Byrd" matches "...smil min byrde..." but not "William Byrd"
  • a search for "Bach" matches "Peter Griesbacher" but not "J.S. Bach"
  • a searche for "Missa" matches "Commissa mea" and "Ite, missa est" but none of the many "Missa XYZ a 4" on this site.
Is anyone else seeing this behavior? Who's the person to report it to for fixing? (Incidentally, I work in tech and would be happy to be of service here.)
choralia
Site Admin
Posts: 2924
Joined: 05 Mar 2006 19:57
Location: Rome, Italy
Contact:

Re: Multi-Category Search "composer name" broken?

Post by choralia »

Thank you for notifying us about this problem.

This function makes use of the DynamicPageList3 extension of the MediaWiki software, and apparently there is a bug with the ignorecase option, i.e., an option that one has to select in order to perform case-insensitive searches on titles or other attributes. I've patched the php code of the extension, and it seems to work now.
maiamcc wrote: 06 Nov 2020 14:27 Incidentally, I work in tech and would be happy to be of service here
If you wish to look into this issue, you're definitely welcome!

This is the project page of the extension on git: https://gitlab.com/hydrawiki/extensions/DynamicPageList. The problem was located in the class Query.php. I had to change this line:

Code: Select all

$_or = "LOWER(CAST({$this->tableNames['page']}.page_title AS char)) {$comparisonType}" . strtolower($this->DB->addQuotes($title));
into:

Code: Select all

$_or = "LOWER({$this->tableNames['page']}.page_title) {$comparisonType}" . strtolower($this->DB->addQuotes($title));
i.e., apparently there was something wrong with the CAST function applied to the page title to convert the title to char type (why converting? isn't a title already a char type? Quite strange).

Please let us know if you understand the cause of the problem better than me, and if you can propose a better fix.

Max
Post Reply