Skip to content

convert all uses of query to filter #84

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

Merged
merged 3 commits into from
Mar 24, 2022

Conversation

philvarner
Copy link
Collaborator

@philvarner philvarner commented Mar 24, 2022

Related Issue(s):

Description:

  • Most of the searches were done using query rather than filter. The difference is that query uses scoring to rank results (more like as free-text search), whereas filter does a SQL select style restriction. Filter is faster than query and results can be cached by ES.
  • fixed the count to reflect how many items where actually being returned.
  • retrieve more than 10 collections now (up to 100)
  • consolidate /collections/{c_id}/items logic to use execute_search instead of mostly-duplicated code.
  • refactor execute_search to return tuple of items and total result count, since both places where this is called need the count also.

PR Checklist:

  • Code is formatted and linted (run pre-commit run --all-files)
  • Tests pass (run make test)
  • Documentation has been updated to reflect changes, if applicable, and docs build successfully (run make docs)
  • Changes are added to the changelog

Copy link
Collaborator

@jonhealy1 jonhealy1 left a comment

Choose a reason for hiding this comment

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

Looks good

@philvarner philvarner merged commit 8f62e23 into main Mar 24, 2022
@philvarner philvarner deleted the pv/use-filter-rather-than-query-for-all-searches branch March 24, 2022 15:51
@philvarner philvarner added this to the 0.1.0 milestone Mar 24, 2022
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