OpenApiTypesense.Analytics (OpenApiTypesense v0.6.5)
View SourceProvides API endpoints related to analytics
Summary
Functions
Create an analytics event
Either one of
Either one of
Creates an analytics rule
Either one of
Either one of
Delete an analytics rule
Either one of
Either one of
Retrieves an analytics rule
Either one of
Either one of
Retrieves all analytics rules
Either one of
Either one of
Upserts an analytics rule
Either one of
Either one of
Functions
@spec create_analytics_event(map()) :: {:ok, OpenApiTypesense.AnalyticsEventCreateResponse.t()} | {:error, OpenApiTypesense.ApiResponse.t()}
Create an analytics event
Sending events for analytics e.g rank search results based on popularity.
@spec create_analytics_event( map() | OpenApiTypesense.Connection.t(), map() | keyword() ) :: {:ok, OpenApiTypesense.AnalyticsEventCreateResponse.t()} | {:error, OpenApiTypesense.ApiResponse.t()}
Either one of:
create_analytics_event(payload, opts)
create_analytics_event(%{api_key: xyz, host: ...}, payload)
create_analytics_event(Connection.new(), payload)
@spec create_analytics_event( map() | OpenApiTypesense.Connection.t(), map(), keyword() ) :: {:ok, OpenApiTypesense.AnalyticsEventCreateResponse.t()} | {:error, OpenApiTypesense.ApiResponse.t()}
Either one of:
create_analytics_event(%{api_key: xyz, host: ...}, payload, opts)
create_analytics_event(Connection.new(), payload, opts)
@spec create_analytics_rule(map()) :: {:ok, OpenApiTypesense.AnalyticsRuleSchema.t()} | {:error, OpenApiTypesense.ApiResponse.t()}
Creates an analytics rule
When an analytics rule is created, we give it a name and describe the type, the source collections and the destination collection.
@spec create_analytics_rule( map() | OpenApiTypesense.Connection.t(), map() | keyword() ) :: {:ok, OpenApiTypesense.AnalyticsRuleSchema.t()} | {:error, OpenApiTypesense.ApiResponse.t()}
Either one of:
create_analytics_rule(payload, opts)
create_analytics_rule(%{api_key: xyz, host: ...}, payload)
create_analytics_rule(Connection.new(), payload)
@spec create_analytics_rule(map() | OpenApiTypesense.Connection.t(), map(), keyword()) :: {:ok, OpenApiTypesense.AnalyticsRuleSchema.t()} | {:error, OpenApiTypesense.ApiResponse.t()}
Either one of:
create_analytics_rule(%{api_key: xyz, host: ...}, payload, opts)
create_analytics_rule(Connection.new(), payload, opts)
@spec delete_analytics_rule(String.t()) :: {:ok, OpenApiTypesense.AnalyticsRuleDeleteResponse.t()} | {:error, OpenApiTypesense.ApiResponse.t()}
Delete an analytics rule
Permanently deletes an analytics rule, given it's name
@spec delete_analytics_rule( map() | OpenApiTypesense.Connection.t() | String.t(), String.t() | keyword() ) :: {:ok, OpenApiTypesense.AnalyticsRuleDeleteResponse.t()} | {:error, OpenApiTypesense.ApiResponse.t()}
Either one of:
delete_analytics_rule(ruleName, opts)
delete_analytics_rule(%{api_key: xyz, host: ...}, ruleName)
delete_analytics_rule(Connection.new(), ruleName)
@spec delete_analytics_rule( map() | OpenApiTypesense.Connection.t(), String.t(), keyword() ) :: {:ok, OpenApiTypesense.AnalyticsRuleDeleteResponse.t()} | {:error, OpenApiTypesense.ApiResponse.t()}
Either one of:
delete_analytics_rule(%{api_key: xyz, host: ...}, ruleName, opts)
delete_analytics_rule(Connection.new(), ruleName, opts)
@spec retrieve_analytics_rule(String.t()) :: {:ok, OpenApiTypesense.AnalyticsRuleSchema.t()} | {:error, OpenApiTypesense.ApiResponse.t()}
Retrieves an analytics rule
Retrieve the details of an analytics rule, given it's name
@spec retrieve_analytics_rule( map() | OpenApiTypesense.Connection.t() | String.t(), String.t() | keyword() ) :: {:ok, OpenApiTypesense.AnalyticsRuleSchema.t()} | {:error, OpenApiTypesense.ApiResponse.t()}
Either one of:
retrieve_analytics_rule(ruleName, opts)
retrieve_analytics_rule(%{api_key: xyz, host: ...}, ruleName)
retrieve_analytics_rule(Connection.new(), ruleName)
@spec retrieve_analytics_rule( map() | OpenApiTypesense.Connection.t(), String.t(), keyword() ) :: {:ok, OpenApiTypesense.AnalyticsRuleSchema.t()} | {:error, OpenApiTypesense.ApiResponse.t()}
Either one of:
retrieve_analytics_rule(%{api_key: xyz, host: ...}, ruleName, opts)
retrieve_analytics_rule(Connection.new(), ruleName, opts)
@spec retrieve_analytics_rules() :: {:ok, OpenApiTypesense.AnalyticsRulesRetrieveSchema.t()} | {:error, OpenApiTypesense.ApiResponse.t()}
Retrieves all analytics rules
Retrieve the details of all analytics rules
@spec retrieve_analytics_rules(map() | OpenApiTypesense.Connection.t() | keyword()) :: {:ok, OpenApiTypesense.AnalyticsRulesRetrieveSchema.t()} | {:error, OpenApiTypesense.ApiResponse.t()}
Either one of:
retrieve_analytics_rules(opts)
retrieve_analytics_rules(%{api_key: xyz, host: ...})
retrieve_analytics_rules(Connection.new())
@spec retrieve_analytics_rules( map() | OpenApiTypesense.Connection.t(), keyword() ) :: {:ok, OpenApiTypesense.AnalyticsRulesRetrieveSchema.t()} | {:error, OpenApiTypesense.ApiResponse.t()}
Either one of:
retrieve_analytics_rules(%{api_key: xyz, host: ...}, opts)
retrieve_analytics_rules(Connection.new(), opts)
@spec upsert_analytics_rule(String.t(), map()) :: {:ok, OpenApiTypesense.AnalyticsRuleSchema.t()} | {:error, OpenApiTypesense.ApiResponse.t()}
Upserts an analytics rule
Upserts an analytics rule with the given name.
@spec upsert_analytics_rule( map() | OpenApiTypesense.Connection.t() | String.t(), String.t() | map(), map() | keyword() ) :: {:ok, OpenApiTypesense.AnalyticsRuleSchema.t()} | {:error, OpenApiTypesense.ApiResponse.t()}
Either one of:
upsert_analytics_rule(ruleName, body, opts)
upsert_analytics_rule(%{api_key: xyz, host: ...}, ruleName, body)
upsert_analytics_rule(Connection.new(), ruleName, body)
@spec upsert_analytics_rule( map() | OpenApiTypesense.Connection.t(), String.t(), map(), keyword() ) :: {:ok, OpenApiTypesense.AnalyticsRuleSchema.t()} | {:error, OpenApiTypesense.ApiResponse.t()}
Either one of:
upsert_analytics_rule(%{api_key: xyz, host: ...}, ruleName, body, opts)
upsert_analytics_rule(Connection.new(), ruleName, body, opts)