Bug 28808 - Item search should allow wildcard in subfield when setting up custom search option
Summary: Item search should allow wildcard in subfield when setting up custom search o...
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-03 17:40 UTC by Andrew Fuerste-Henry
Modified: 2021-08-03 18:08 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Fuerste-Henry 2021-08-03 17:40:26 UTC
When querying a MARC record via SQL directly, one can wildcard the subfield to search an entire MARC tag -- like "ExtractValue(metadata,'//datafield[@tag="650"]/*')" to look at the whole 650 without specifying a subfield.

It would be nice to be able to select "*" for one's subfield when setting up a custom item search field. As is, you have to either leave it blank (which will break all searches) or pick a specific value.
Comment 1 Nick Clemens (kidclamp) 2021-08-03 18:08:03 UTC
Currently the code is something like:
ExtractValue(metadata,'//record/datafield[@tag="XXX"]/subfield[@code="Y"]') LIKE 'TERM'

If we defaulted to a contains search we could implement as:
SELECT ExtractValue(metadata,'//datafield[@tag="XXX"]/subfield[@code="Y" AND contains(.,"TERM")]')