module Elastic::SiteSearch::Client::Analytics

The analytics API provides a way to export analytics data similar to what is found in the Site Search Dashboard. See the REST API Documentation for details.

Public Instance Methods

analytics_autoselects(engine_id, options={}) click to toggle source

Return the number of autoselects (when a user clicks a result from an autocomplete dropdown) that occurred on each day in the time range for the provided Engine and optional DocumentType. The maximum time range between start and end dates is 30 days.

@param [String] engine_id the Engine slug or ID @param [Hash] options @option options [String] :document_type_id the DocumentType slug or ID @option options [String] :start_date a date formatted like '2013-01-01' @option options [String] :end_date to a date formatted like '2013-01-01'

# File lib/elastic/site-search/client.rb, line 410
def analytics_autoselects(engine_id, options={})
  document_type_id = options.delete(:document_type_id)
  if document_type_id
    get("engines/#{engine_id}/document_types/#{document_type_id}/analytics/autoselects.json", options)
  else
    get("engines/#{engine_id}/analytics/autoselects.json", options)
  end
end
analytics_clicks(engine_id, options={}) click to toggle source

Return the number of clickthroughs (when a user clicks a result from a search results page) that occurred on each day in the time range for the provided Engine and optional DocumentType. The maximum time range between start and end dates is 30 days.

@param [String] engine_id the Engine slug or ID @param [Hash] options @option options [String] :document_type_id the DocumentType slug or ID @option options [String] :start_date a date formatted like '2013-01-01' @option options [String] :end_date to a date formatted like '2013-01-01'

# File lib/elastic/site-search/client.rb, line 428
def analytics_clicks(engine_id, options={})
  document_type_id = options.delete(:document_type_id)
  if document_type_id
    get("engines/#{engine_id}/document_types/#{document_type_id}/analytics/clicks.json", options)
  else
    get("engines/#{engine_id}/analytics/clicks.json", options)
  end
end
analytics_searches(engine_id, options={}) click to toggle source

Return the number of searches that occurred on each day in the time range for the provided Engine and optional DocumentType. The maximum time range between start and end dates is 30 days.

@param [String] engine_id the Engine slug or ID @param [Hash] options @option options [String] :document_type_id the DocumentType slug or ID @option options [String] :start_date a date formatted like '2013-01-01' @option options [String] :end_date to a date formatted like '2013-01-01'

# File lib/elastic/site-search/client.rb, line 392
def analytics_searches(engine_id, options={})
  document_type_id = options.delete(:document_type_id)
  if document_type_id
    get("engines/#{engine_id}/document_types/#{document_type_id}/analytics/searches.json", options)
  else
    get("engines/#{engine_id}/analytics/searches.json", options)
  end
end
analytics_top_no_result_queries(engine_id, options={}) click to toggle source

Return top queries with no results for an engine.

@param [String] engine_id the engine slug or ID @param [Hash] options @option options [String] :start_date a date formatted like '2013-01-01' @option options [String] :end_date a date formatted like '2013-01-01' @option options [Integer] :page page number. The server defaults to page 1 and the maximum is 50. @option options [Integer] :per_page number of results per page. The server defaults to 20 and the maximum is 100.

# File lib/elastic/site-search/client.rb, line 457
def analytics_top_no_result_queries(engine_id, options={})
  get("engines/#{engine_id}/analytics/top_no_result_queries.json", options)
end
analytics_top_queries(engine_id, options={}) click to toggle source

Return top queries for an engine.

@param [String] engine_id the engine slug or ID @param [Hash] options @option options [String] :start_date a date formatted like '2013-01-01' @option options [String] :end_date a date formatted like '2013-01-01' @option options [Integer] :page page number. The server defaults to page 1 and the maximum is 50. @option options [Integer] :per_page number of results per page. The server defaults to 20 and the maximum is 100.

# File lib/elastic/site-search/client.rb, line 445
def analytics_top_queries(engine_id, options={})
  get("engines/#{engine_id}/analytics/top_queries.json", options)
end