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

Take advantage of Elasticsearch filter context when we can #6111

Closed
diox opened this issue Oct 20, 2018 · 6 comments · Fixed by mozilla/addons-server#9979 or mozilla/addons-server#9966

Comments

@diox
Copy link
Member

diox commented Oct 20, 2018

Currently, with the exception of the exclude_addons parameter, the search API uses a bool query with a list of several must clauses. Elasticsearch supports another type of context, filter, which can be used to filter documents without applying a score.

The filter context clauses can be cached by ES automatically and should lead to better performance. There are quite a number of things where we could use it - basically all our AddonQueryParam classes except AddonExcludeAddonsQueryParam which is already a must_not.

Also: it could be useful in AddonRecommendationView, which wants only specific guids.

@diox
Copy link
Member Author

diox commented Oct 20, 2018

Notes:

  • In SearchParameterFilter we need to stop calling the internal classes available_filters... that's confusing.
  • ReviewedContentFilter needs to call filter instead of doing a new Bool query, I think. Need to check the resulting elasticsearch query

@diox
Copy link
Member Author

diox commented Nov 13, 2018

QA: Check that search works, again :) Also make sure things like making sure the list of add-ons by an author on the detail page works, correctly showing all other add-ons by this author than the one you're visiting, and also making sure non-public content is not returned by search.

@diox diox reopened this Nov 13, 2018
@diox
Copy link
Member Author

diox commented Nov 13, 2018

This seems to be causing some issues on dev - the featured extensions&themes are no longer found. It could be something else but I'm suspecting these changes, so I'll be reverting them to see if that does fix it.

@diox
Copy link
Member Author

diox commented Nov 13, 2018

Reverted in mozilla/addons-server#9979

@diox
Copy link
Member Author

diox commented Nov 13, 2018

Reverted the revert since it wasn't the cause of the problem, which is tracked in #6177

@diox diox closed this as completed Nov 13, 2018
@AlexandraMoga
Copy link

I've verified this on -dev and stage and I didn't find regressions around any of the search related functionalities mentioned.

@KevinMind KevinMind transferred this issue from mozilla/addons-server May 4, 2024
@KevinMind KevinMind added repository:addons-server Issue relating to addons-server migration:2024 labels May 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment