-
Notifications
You must be signed in to change notification settings - Fork 359
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
VUFIND-1710 Add configurable separators for topics in alphabrowse #4011
VUFIND-1710 Add configurable separators for topics in alphabrowse #4011
Conversation
Currently, subjects are shown differently between the record view in VuFind and the topic browse. In the record view you see delimiters like this: Morris, William, > 1834-1896 > Criticism and interpretation. But in the topic browse, the fields are just joined with spaces: Morris, William, 1834-1896 Criticism and interpretation. This commit: * Adds a UTF-8 separator to delimit terms within topics in the Solr index * Adjusts the topic_browse definition to use a new TopicNormalizer, which strips out these new delimiters when building the sort key. * Changes the frontend of the AlphaBrowse to insert a user-configurable delimiter, shown when browsing topics. Note: since Normalizer classes currently live in the vufind-browse-handler, there will be a corresponding commit there to add TopicNormalizer.
@demiankatz @dltj Just sending the pull request for VUFIND-1710 to get the review rolling :) Note that there's also a vufind-browse-handler PR to go with this one: vufind-org/vufind-browse-handler#51. I wasn't sure how best to handle the bundled |
Thanks, @marktriggs! vufind-org/vufind-browse-handler#51 looks reasonable to me, so I've gone ahead and merged it. That way, you can now build the .jar artifacts and add them to this PR so that we can test the whole thing together. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here are a few comments from an initial review; I'll do more hands-on and automated testing once the .jar files have been added.
I'm also going to pin this to the 11.0 release, since 10.1 is very close and I don't want to introduce last-minute Solr schema changes.
Built from commit 25863e56d0fd4b02deedbfd72aca7a5c4885bdd7 in vufind-org/vufind-browse-handler
Thanks @demiankatz, I've applied the changes from your first review, and have checked in the updated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @marktriggs. I can try to test this out in Windows soon -- just having a busy week and haven't gotten that far yet.
In the meantime, see below for a tiny style suggestion.
Also, did you notice that tests are failing in PHP 8.3? Please let me know if you need any help investigating/sorting that out.
The modified AlphaBrowse now makes use of sort_key, which is returned by the browse handler. This is basically the heading as stored in the Solr index, as opposed to the 'heading' key which will have been manipulated for display in some cases (such as Topic browse)
Thanks @demiankatz, and no rush from me. I've fixed the comment syntax and figured out why that test was failing. The AlphaBrowse code returns items with keys Historically that didn't matter because the browse frontend only used But now we're rewriting the delimiter in topics, what we display to the user isn't the same as what's in the index. So, |
@marktriggs, I was able to confirm that this works correctly in Windows. I tested the dev branch: no separators; I switched to this branch and rebuilt the index: separators appeared! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me, and all tests are passing in my local environment. I'll just leave this open a little longer in case @dltj or others have any last-minute suggestions or concerns.
I'm good-to-go with this. Thanks, Mark and Demian! |
Currently, subjects are shown differently between the record view in VuFind and the topic browse. In the record view you see delimiters like this:
But in the topic browse, the fields are just joined with spaces:
This commit:
Adds a UTF-8 separator to delimit terms within topics in the Solr index
Adjusts the topic_browse definition to use a new TopicNormalizer, which strips out these new delimiters when building the sort key.
Changes the frontend of the AlphaBrowse to insert a user-configurable delimiter, shown when browsing topics.
Note: since Normalizer classes currently live in the vufind-browse-handler, there will be a corresponding commit there to add TopicNormalizer.
TODO