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
Add setting to allow deep searching within collections. #3182
Merged
demiankatz
merged 6 commits into
vufind-org:dev
from
demiankatz:collection-search-config
Oct 26, 2023
Merged
Add setting to allow deep searching within collections. #3182
demiankatz
merged 6 commits into
vufind-org:dev
from
demiankatz:collection-search-config
Oct 26, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
EreMaijala
requested changes
Oct 26, 2023
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.
Looks pretty good to me, just some minor details.. :)
module/VuFind/src/VuFind/Hierarchy/Driver/ConfigurationBased.php
Outdated
Show resolved
Hide resolved
Thanks, @EreMaijala -- all good suggestions; I've applied them. |
EreMaijala
reviewed
Oct 26, 2023
module/VuFind/src/VuFind/Hierarchy/Driver/ConfigurationBased.php
Outdated
Show resolved
Hide resolved
EreMaijala
approved these changes
Oct 26, 2023
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, looks good to me now!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is needed to support some improved functionality for Villanova's Digital Library. I'm not sure how likely it is to be useful in other situations, but it at least improves code readability by eliminating a switch statement, so maybe it's worth merging for that alone -- and the extra flexibility it adds is easily ignored.
The situation is this: when "link_type" is set to All in HierarchyDefault.ini and you have a deeply-nested set of collections, you can only see one level of the hierarchy at a time (which is desired -- we want a "drill down" navigation). However, if you use the "search within collection" feature, you also only search within the current level you are looking at, which can be confusing. It would be better to search the current level and also all deeper levels.
This PR adds a setting which allows a different collection filter field to be used when the user inputs a search than when they are viewing the collection without a search.
Note that the desired functionality is not possible with the minimum Solr schema defined in the documentation. It requires a new hierarchy_all_parents_str_mv field which contains the entire chain of parent IDs, not just the top parent/immediate parent. We already have this field as part of our custom indexing process at Villanova.
You can get a general idea of the functionality I'm proposing (though it will only work at the top level of any given collection tree), you can set up a test like this (using the standard test environment created by Phing):
1.) In HierarchyDefault.ini, set link_type to "All".
2.) In config.ini, set
collections = true
in the [Collections] section.3.) Navigate to
http://localhost/vufind_test/Collection/topcollection1
-- you will see two items and two subcollections.4.) Search for "item" in the "Search within collection" box. You will see only two matches -- the items directly within this collection. Even though there are also matching items within the subcollections, they will not be seen.
5.) Now change search_container_field to hierarchy_top_id in HierarchyDefault.ini and repeat the search from step 4. You will see more matches, because the grandchildren are now accessible to the search.
TODO