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

Fix issues with too long sets of work keys in queries and URLs #3087

Merged
merged 6 commits into from Sep 14, 2023

Conversation

EreMaijala
Copy link
Contributor

No description provided.

The terms query should also provide better performance.
Work keys query is now a separate query type.
@demiankatz demiankatz added this to the 9.1 milestone Sep 13, 2023
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.

I haven't tried this hands-on yet, but it looks logical to me. I've left a handful of minor comments.

This might also be a good time to review the Mink RecordVersionsTest and make sure it's covering everything that it should, if you have a moment... want to be sure we can reliably use that as a before-and-after to be confident that the refactoring hasn't obviously changed/broken anything.

module/VuFind/src/VuFind/Search/Base/Params.php Outdated Show resolved Hide resolved
module/VuFind/src/VuFind/Search/QueryAdapter.php Outdated Show resolved Hide resolved
}
$params->set('q', implode(' OR ', $query));
$params->set('q', '{!terms f=work_keys_str_mv}' . implode(',', $terms));
Copy link
Member

Choose a reason for hiding this comment

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

Can we guarantee that no term will ever contain a comma?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No. I thought escaping the delimiter above would be enough, but now that I checked it, that doesn't work. I'll think about an alternative.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed the delimiter to chr(1F) and removed the useless escaping (verified manually with Solr that all the characters can be in a term as is).

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.

This is looking good to me now, and all tests are passing. Thanks for the fix, @EreMaijala!

@demiankatz demiankatz merged commit bb95466 into vufind-org:dev Sep 14, 2023
7 checks passed
@demiankatz demiankatz deleted the dev-work-keys-terms-parser branch September 14, 2023 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants