Module: Swiftype::Client::Clickthrough

Included in:
Swiftype::Client
Defined in:
lib/swiftype/client.rb

Overview

A Clickthrough represents a user clicking on a full-text search result.

If you are routing searches through your own server instead of executing them client-side with the Swiftype JavaScript API, you will need to record clickthroughs yourself.

Instance Method Summary collapse

Instance Method Details

#log_clickthrough(engine_id, document_type, q, id) ⇒ Object

Log a clickthrough for a Document.

Parameters:

  • engine_id (String)

    the Engine slug or ID

  • document_type (String)

    the DocumentType slug or ID

  • q (String)

    the query that generated the search result

  • id (String)

    the external_id or ID of the Document



441
442
443
444
445
446
# File 'lib/swiftype/client.rb', line 441

def log_clickthrough(engine_id, document_type, q, id)
  post(
    "engines/#{engine_id}/document_types/#{document_type}/analytics/log_clickthrough.json",
    {:q => q, :id => id}
  )
end