Class: QuickSearch::AppstatsController

Inherits:
ApplicationController show all
Includes:
Auth
Defined in:
app/controllers/quick_search/appstats_controller.rb

Constant Summary

Constants included from Auth

QuickSearch::Auth::REALM, QuickSearch::Auth::SALT01, QuickSearch::Auth::SALT02, QuickSearch::Auth::SALTY, QuickSearch::Auth::USERS

Instance Method Summary collapse

Methods included from Auth

#auth

Instance Method Details

#clicks_overviewObject



12
13
14
15
16
17
# File 'app/controllers/quick_search/appstats_controller.rb', line 12

def clicks_overview
  @page_title = 'Clicks Overview'
  module_clicks
  result_types_clicks
  typeahead_clicks
end

#detailObject



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'app/controllers/quick_search/appstats_controller.rb', line 39

def detail
  start_date
  end_date
  @category = params[:ga_category]
  if params[:ga_scope] == 'action'
    @action = params[:ga_action]
    @page_title = "#{@category} (#{URI.decode(@action)})"
    top_spot_detail(@category, @action)
    render "top_spot_detail"
  elsif params[:ga_scope] == 'category'
    @page_title = "#{@category}"
    module_click_detail(@category)
    render "module_click_detail"
  end
end

#indexObject



7
8
9
10
# File 'app/controllers/quick_search/appstats_controller.rb', line 7

def index
  @page_title = 'Search Statistics'
  search_click_ratio
end

#realtimeObject



55
56
# File 'app/controllers/quick_search/appstats_controller.rb', line 55

def realtime
end

#top_searchesObject



19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'app/controllers/quick_search/appstats_controller.rb', line 19

def top_searches
  @page_title = 'Top Searches'
  searches_count
  searches = Search.where(page: '/').where(date_range)
  queries = []
  searches.each do |search|
    queries << search["query"].downcase
  end
  @query_counts = Hash.new(0)
  queries.each do |query|
    @query_counts[query] += 1
  end
  @query_counts = @query_counts.sort_by {|k,v| v}.reverse[0..199]
end

#top_spotObject



34
35
36
37
# File 'app/controllers/quick_search/appstats_controller.rb', line 34

def top_spot
  @page_title = params[:ga_top_spot_module]
  top_spot_reporting(params[:ga_top_spot_module])
end