Documentation
¶
Index ¶
- func NewContext(ctx context.Context, analyticsrequest Record) context.Context
- type AnalyticsRequest
- func (a *AnalyticsRequest) AlternateRoutes() []plugins.Route
- func (c *AnalyticsRequest) ESMiddleware() []middleware.Middleware
- func (c *AnalyticsRequest) InitFunc() error
- func (f *AnalyticsRequest) Name() string
- func (c *AnalyticsRequest) RSMiddleware() []middleware.Middleware
- func (c *AnalyticsRequest) Routes() []plugins.Route
- type CustomEvent
- type HIT
- type Record
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AnalyticsRequest ¶
type AnalyticsRequest struct{}
func Instance ¶
func Instance() *AnalyticsRequest
Instance returns the singleton instace of AnalyticsRequest plugin. Note: Only this function must be used (both within and outside the package) to obtain the instance AnalyticsRequest in order to avoid stateless instances of the plugin.
func (*AnalyticsRequest) AlternateRoutes ¶
func (a *AnalyticsRequest) AlternateRoutes() []plugins.Route
Expose plugin specific routes
func (*AnalyticsRequest) ESMiddleware ¶
func (c *AnalyticsRequest) ESMiddleware() []middleware.Middleware
func (*AnalyticsRequest) InitFunc ¶
func (c *AnalyticsRequest) InitFunc() error
InitFunc is a part of Plugin interface that gets executed only once, and initializes the dao, i.e. elasticsearch before the plugin is operational.
func (*AnalyticsRequest) Name ¶
func (f *AnalyticsRequest) Name() string
Name returns the name of the plugin: "analyticsrequest"
func (*AnalyticsRequest) RSMiddleware ¶
func (c *AnalyticsRequest) RSMiddleware() []middleware.Middleware
func (*AnalyticsRequest) Routes ¶
func (c *AnalyticsRequest) Routes() []plugins.Route
type CustomEvent ¶
type CustomEvent struct {
Key string `json:"key"`
Value interface{} `json:"value"`
}
type Record ¶
type Record struct {
Took float64 `json:"took,omitempty"`
SearchQuery *string `json:"search_query,omitempty"`
QueryLength *int `json:"search_characters_length,omitempty"`
SearchQueryLength *int `json:"search_query_length,omitempty"`
Index string `json:"index,omitempty"`
Indices []string `json:"indices,omitempty"`
HitsInResponse *[]HIT `json:"hits_in_response,omitempty"`
TotalHits *int64 `json:"total_hits,omitempty"`
TimeStamp string `json:"timestamp,omitempty"`
IP string `json:"ip,omitempty"`
Location string `json:"location,omitempty"`
Country string `json:"country,omitempty"`
City string `json:"city,omitempty"`
SearchFilters *[]querytranslate.TermFilter `json:"search_filters,omitempty"`
SearchState string `json:"search_state,omitempty"`
UserID string `json:"user_id,omitempty"`
ResultClickObjectIds []string `json:"result_click_object_ids,omitempty"`
ResultClickPositionIds []int `json:"result_click_position_ids,omitempty"`
SuggestionsClickObjectIds []string `json:"suggestion_click_object_ids,omitempty"`
SuggestionsClickPositionIds []int `json:"suggestion_click_position_ids,omitempty"`
Conversion bool `json:"conversion,omitempty"`
ConversionObjectIds []string `json:"conversion_object_ids,omitempty"`
StoredQueries *[]string `json:"storedqueries,omitempty"`
QueryRules *[]string `json:"queryrules,omitempty"`
CustomEvents []CustomEvent `json:"custom_events,omitempty"` // Note: we save it differently
URL *string `json:"url,omitempty"`
Method *string `json:"method,omitempty"`
Meta *map[string]interface{} `json:"meta"`
}
Record represents the analytics doc for a record
Click to show internal directories.
Click to hide internal directories.