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

Personalise events by user sector and country of interest #714

Merged
merged 3 commits into from May 6, 2020

Conversation

richtier
Copy link
Contributor

@richtier richtier commented May 6, 2020

To do (delete all that do not apply):

  • Change has a jira ticket that has the correct status.
  • Changelog entry added.
  • (if there are vulnerable requirements) Upgraded any vulnerable dependencies.
  • (if updating requirements) Requirements have been compiled.

events-expertise

return json.dumps({
'query': {
'match_all': {}
},
'sort': [{
Copy link
Contributor Author

Choose a reason for hiding this comment

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

had to replace the existing sorting because otherwise the search terms would not be respected - it would find documents by the provided terms but then order the results by how close the venue is to the user, meaning a result with a relevance score of 0.001 would be ahead of one with relevance score of 0.999 if the 0.001 one was geographically closer.

Replaced that sorting with exponential decay function - so values close to the user are boosted, but the relevance score is still respected,

Copy link
Contributor

Choose a reason for hiding this comment

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

Awesome!

terms=self.get_search_terms()
)
response = helpers.search_with_activitystream(query)
response.raise_for_status()
Copy link
Contributor Author

@richtier richtier May 6, 2020

Choose a reason for hiding this comment

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

this has more-or-less the same outcome as before: a non-200 response is returned and the error ends up in sentry, but with less codes

return json.dumps({
'query': {
'match_all': {}
},
'sort': [{
Copy link
Contributor

Choose a reason for hiding this comment

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

Awesome!

@codecov-io
Copy link

Codecov Report

Merging #714 into develop will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #714      +/-   ##
===========================================
- Coverage    96.52%   96.52%   -0.01%     
===========================================
  Files           97       97              
  Lines         2938     2937       -1     
===========================================
- Hits          2836     2835       -1     
  Misses         102      102              
Impacted Files Coverage Δ
company/helpers.py 100.00% <100.00%> (ø)
personalisation/helpers.py 81.57% <100.00%> (+0.49%) ⬆️
personalisation/views.py 95.08% <100.00%> (-0.24%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 534611f...105cae1. Read the comment docs.

@richtier richtier merged commit 474255d into develop May 6, 2020
@richtier richtier deleted the MVP-416-recomment-events branch May 6, 2020 10:59
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.

None yet

3 participants