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

UHF-11462: Performance improvements to Linked Events query parameter handling #909

Merged
merged 5 commits into from
Feb 21, 2025

Conversation

wktohesi
Copy link
Contributor

@wktohesi wktohesi commented Feb 18, 2025

UHF-11462

Requests from Linked Events React search components to Linked Events API are currently prone to timeouts, especially when a text search query parameter is included. It was suggested in the ticket that using a keyword instead would make the request more performant. This PR attempts to do just that.

Background investigation and performance testing

What was done

  • Adds a text parameter handler where certain text searches can be converted into keyword parameters instead of using the less performant all_ongoing_AND-parameter, which is still the default fot texts other than tyollisuus or työllisyys. This was removed after discussing with Aleksi. Better to use this enhancement manually for now (by adding the keyword parameter manually) which makes it a conscious decision between a slightly different result set and performance.
  • Adds parameter handling for a manual keyword query parameter to allow filtering with known keywords (even though such filtering isn't available in https://tapahtumat.hel.fi/). Also makes sure keywords can be set from different parameters without them overriding each other.
  • Updates unit tests to cover some parameter handling use cases.

How to install

See install steps in City-of-Helsinki/drupal-hdbt#1196

How to test

  • Check that keyword parameters set by different parameter handlers work together
    • Go to https://helfi-elo.docker.so/fi/yritykset-ja-tyo/tyollisyyspalveluiden-tapahtumat and edit the page.
    • Update the Api URL-field with https://tapahtumat.hel.fi/fi/haku?start=2025-01-31&categories=movie&keyword=yso:p6357 and Save
    • Open inspector network tab and search for api.hel.fi/linkedevents/v1 (reload if needed to get it there)
    • Make sure the api call includes multiple values in the keyword-parameter (one manual and one set by the categories-handling)
  • Check that code follows our standards

Continuous documentation

  • This change doesn't require updates to the documentation

Other PRs

@wktohesi wktohesi force-pushed the UHF-11462_linkedevents_cleanup branch from 15fd2db to c83ffbd Compare February 19, 2025 07:45
… when converting a text value into a keyword. Parameter all_ongoing=true is already added whenever all_ongoing_AND is not present and it effectively does the same thing.
…lacements to keyword filtering as requested by the PO; it felt a bit of a hack matching such a small use case. Also it's possible to gain the performance enhancement by adding a keyword to the api url manually, which makes it a more concious decision, especially as the result set is slightly different.
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