-
Notifications
You must be signed in to change notification settings - Fork 360
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
ProQuestFSG: Support Blender mode #4239
base: dev
Are you sure you want to change the base?
Conversation
@@ -105,6 +105,11 @@ public function search(ParamBag $params, $offset, $limit) | |||
$params->set('operation', 'searchRetrieve'); | |||
$params->set('recordSchema', 'marcxml'); | |||
|
|||
// TEMP -- blender wants to start at zero |
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.
Yeah... haven't solved this yet. ProQuest's offset starts at 1.
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.
I think it would be better for offset to always be 0-based in VuFind, because it's displacement from the first record, i.e. for offset it doesn't really matter if first record is 0 or 1 in the API, because it's always relative to the first record. Adjust as necessary in the Proquest API calls instead.
usort($facetValues, fn ($a, $b) => ($a['count'] ?? 0) < ($b['count'] ?? 0)); | ||
$values = []; | ||
foreach ($facetValues as $facetValue) { | ||
$facetValueName = "{$facetValue['code']}|{$facetValue['name']}"; |
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.
I used a |
as the delimiter in the original ProQuestFSG code as well, and it works fine, but it does make the declaration of the delimiter in Blender.ini a little awkward:
[Advanced_Settings]
delimited_facets[] = "source||"
So could change it to something else if preferred.
As I added above as a TODO, the Source facet will only ever apply to one backend at a time, and both EDS and ProQuest throw errors when you try faceting on the other one's database. There should be a way to short-circuit that process before the wrong one is searched, but the facets don't seem to store the source of each blended value (since usually they are supposed to work in multiple backends and it's not an issue). On the ProQuest side it's particularly bad because the error returned is an SRU authentication error (1,3), as it thinks I'm requesting a database that we're not subscribed to. That's the same error code as wrong-IP-address error, so I can't just silently ignore it. In theory I could parse the actual error message text but that's going to be brittle so a last resort. The other last resort is of course not to use the source facet at all, but that makes the entire Blender display much less useful. |
Early input welcome @demiankatz @EreMaijala |
I think you have to fill in the |
Right, that would work if I had all the data --- and to be fair I can probably get it on the EDS side since empty searches are allowed. Not so for ProQuest. And of course the list will change over time. So this is maybe a third bad option and like you say I am curious whether @EreMaijala has other ideas. |
@@ -105,6 +105,11 @@ public function search(ParamBag $params, $offset, $limit) | |||
$params->set('operation', 'searchRetrieve'); | |||
$params->set('recordSchema', 'marcxml'); | |||
|
|||
// TEMP -- blender wants to start at zero |
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.
I think it would be better for offset to always be 0-based in VuFind, because it's displacement from the first record, i.e. for offset it doesn't really matter if first record is 0 or 1 in the API, because it's always relative to the first record. Adjust as necessary in the Proquest API calls instead.
The source facet is a tricky one. I'm not sure if there's a good way to handle it as a blended facet (apart from mapping all the possible values). Perhaps it would be better to make ProquestFSG's source a separate facet? It's not very elegant, I know, but that, or parsing the error message are the options that come to my mind. I suppose there's the additional issue that the FSG would return an error also if you selected a source that it supports as well as one that it doesn't, right? That would be hugely confusing. |
The original ProQuestFSG did some custom facet logic that worked, but it turns out not as a Blender target. This works and brings things (hopefully) more into line with normal facet handling.
To test blending ProQuest with EDS (which is probably the most likely combination?), and the single shared facet (source / database), you need:
TODO