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

Extended search: do not cache operator options across corpora #409

Closed
arildm opened this issue Nov 21, 2024 · 1 comment
Closed

Extended search: do not cache operator options across corpora #409

arildm opened this issue Nov 21, 2024 · 1 comment

Comments

@arildm
Copy link
Member

arildm commented Nov 21, 2024

The getOpts function in extendedCqpTerm builds operator options for the selected attribute. It is memoized, so the same attribute will yield the same operator options. However, different corpora may have different settings for the same attribute name. [Example needed.] Because of the memoizing, when changing corpus selection, the operator options will not change as they should.

It doesn't look to me like the memoizing is really needed. Try removing it. Otherwise, maybe use .cache of the memoized function to clear the cache when changing corpora. Or include corpus selection as an argument to cache by.

@arildm arildm added the bug label Nov 21, 2024
@arildm arildm removed the bug label Feb 6, 2025
@arildm
Copy link
Member Author

arildm commented Mar 3, 2025

Example: kvah and akerbruk in the Old texts mode have different opts for the text_title attribute:

  1. Select kvah: https://spraakbanken.gu.se/korplabb/?mode=all_hist#?cqp=%5B_.text_title%20%3D%20%22%22%5D&corpus=kvah&search_tab=1
  2. The options are the 7 standard options
  3. Switch to akerbruk using the corpus selector
  4. Expected: There should be 2 options, is and is not
  5. Actual: The 7 standard options are still there
  6. Refresh the page to see that the 2 options are properly shown, now that the options are not cached from the previous corpus

@arildm arildm closed this as completed in bab3cde Mar 3, 2025
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

No branches or pull requests

1 participant