Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better use of call numbers for similar items #4119

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

damien-git
Copy link
Contributor

@damien-git damien-git commented Nov 27, 2024

This PR makes callnumber-label multivalued, uses all available LCC and Dewey call numbers, and extracts different parts of them to make similar items compare call numbers at different levels of precision.

It keeps backward-compatible. To take advantage of the new values, a full import should be done. But not doing it will not break anything (Solr will convert the single values to the new array format).

FOLIO users should add 952e to the call.

Copy link
Member

@demiankatz demiankatz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @damien-git! I'll take a little time to test this next week after the holiday. In the meantime, one thought: when I search the code for callnumber-label I find that we have quite a few test fixtures that contain a single value for the field. Is it worth updating the fixtures to make it an array just for consistency? I doubt this will change the behavior of any tests, but it might be good to keep the fixtures as realistic as possible.

Copy link
Member

@demiankatz demiankatz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@damien-git, I haven't had a chance to try this hands-on yet, but just one more thought based on a closer look at the code. I'll wait and see if you think this is worth adjusting before I do my testing -- please let me know, and I'll test the finalized code once I hear back from you.

int dotPos = val.indexOf(".");
if (dotPos > 0) {
val = val.substring(0, dotPos);
public List<String> getCallNumberLabel(final Record record, String fieldSpec) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For backward-compatibility, how about renaming this method to getCallNumberLabels, and then keeping a getCallNumberLabel method that returns the first value from getCallNumberLabels?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants