diff --git a/server/src/data/models.rs b/server/src/data/models.rs index f35852dcc..77affed87 100644 --- a/server/src/data/models.rs +++ b/server/src/data/models.rs @@ -4371,6 +4371,7 @@ impl From for SearchLatencyGraph { pub struct SearchCTRMetricsClickhouse { pub searches_with_clicks: i64, pub percent_searches_with_clicks: f64, + pub percent_searches_without_clicks: f64, pub avg_position_of_click: f64, } @@ -4378,6 +4379,7 @@ pub struct SearchCTRMetricsClickhouse { pub struct SearchCTRMetrics { pub searches_with_clicks: i64, pub percent_searches_with_clicks: f64, + pub percent_searches_without_clicks: f64, pub avg_position_of_click: f64, } @@ -4388,6 +4390,9 @@ impl From for SearchCTRMetrics { percent_searches_with_clicks: f64::from_be_bytes( metrics.percent_searches_with_clicks.to_be_bytes(), ), + percent_searches_without_clicks: f64::from_be_bytes( + metrics.percent_searches_without_clicks.to_be_bytes(), + ), avg_position_of_click: f64::from_be_bytes(metrics.avg_position_of_click.to_be_bytes()), } } diff --git a/server/src/operators/analytics_operator.rs b/server/src/operators/analytics_operator.rs index 54d512144..d53237032 100644 --- a/server/src/operators/analytics_operator.rs +++ b/server/src/operators/analytics_operator.rs @@ -877,6 +877,7 @@ pub async fn get_search_ctr_metrics_query( SELECT searches_with_clicks, (searches_with_clicks * 100.0 / total) AS percent_searches_with_click, + ((total - searches_with_clicks) * 100.0 / total) AS percent_searches_without_click, avg_position_of_click FROM ( SELECT