Chelsyx has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370977 )

Change subject: Remove duplicated clicks on the same position for each query 
when computing paulscore
......................................................................

Remove duplicated clicks on the same position for each query when computing 
paulscore

Bug: T172960
Change-Id: I972500c6150408a119f2c80dad9fe8a49f00845e
---
M modules/metrics/search/paulscore_approximations.R
1 file changed, 8 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/discovery/golden 
refs/changes/77/370977/1

diff --git a/modules/metrics/search/paulscore_approximations.R 
b/modules/metrics/search/paulscore_approximations.R
index 1f7fe9f..1a1ede0 100644
--- a/modules/metrics/search/paulscore_approximations.R
+++ b/modules/metrics/search/paulscore_approximations.R
@@ -35,11 +35,14 @@
   SUM(IF(event_action = 'click', POW(0.7, event_position), 0)) / 
SUM(IF(event_action = 'searchResultPage', 1, 0)) AS pow_7,
   SUM(IF(event_action = 'click', POW(0.8, event_position), 0)) / 
SUM(IF(event_action = 'searchResultPage', 1, 0)) AS pow_8,
   SUM(IF(event_action = 'click', POW(0.9, event_position), 0)) / 
SUM(IF(event_action = 'searchResultPage', 1, 0)) AS pow_9
-FROM TestSearchSatisfaction2_", dplyr::if_else(as.Date(opt$date) < 
"2017-02-10", "15922352", dplyr::if_else(as.Date(opt$date) < "2017-06-29", 
"16270835", "16909631")), "
-WHERE ", date_clause, "
-  AND event_action IN ('searchResultPage', 'click')
-  AND IF(event_source = 'autocomplete', event_inputLocation = 'header', TRUE)
-  AND IF(event_source = 'autocomplete' AND event_action = 'click', 
event_position >= 0, TRUE)
+FROM
+  (SELECT event_searchSessionId, event_source, wiki, event_action, 
event_position, event_pageViewId, event_query
+   FROM TestSearchSatisfaction2_", dplyr::if_else(as.Date(opt$date) < 
"2017-02-10", "15922352", dplyr::if_else(as.Date(opt$date) < "2017-06-29", 
"16270835", "16909631")), "
+  WHERE ", date_clause, "
+    AND event_action IN ('searchResultPage', 'click')
+    AND IF(event_source = 'autocomplete', event_inputLocation = 'header', TRUE)
+    AND IF(event_source = 'autocomplete' AND event_action = 'click', 
event_position >= 0, TRUE)
+  GROUP BY event_searchSessionId, event_source, wiki, event_action, 
event_position, event_pageViewId, event_query) AS deduplicate
 GROUP BY date, event_searchSessionId, event_source, wiki;")
 
 # Fetch data from MySQL database:

-- 
To view, visit https://gerrit.wikimedia.org/r/370977
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I972500c6150408a119f2c80dad9fe8a49f00845e
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/discovery/golden
Gerrit-Branch: master
Gerrit-Owner: Chelsyx <c...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to