View Source Algoliax (Algoliax v0.7.1)

Algoliax is wrapper for Algolia api

configuration

Configuration

Algoliax needs only :api_key and application_id config. These configs can either be on config files or using environment varialble "ALGOLIA_API_KEY" and "ALGOLIA_APPLICATION_ID".

config :algoliax,
  api_key: "",
  application_id: ""

Link to this section Summary

Functions

Generate a secured api key with filter

Same as generate_secured_api_key/2 but returns the key or raises if invalid params

Wait for a task to be published on Algolia side. Work with all indexer function except reindex_atomic/0

Link to this section Functions

Link to this function

generate_secured_api_key(api_key, params)

View Source

Specs

generate_secured_api_key(api_key :: String.t(), params :: map()) ::
  {:ok, binary()} | {:error, binary()}

Generate a secured api key with filter

examples

Examples

Algoliax.generate_secured_api_key("api_key", %{filters: "reference:10"})
Algoliax.generate_secured_api_key("api_key", %{filters: "reference:10 OR nickname:john"})
Link to this function

generate_secured_api_key!(api_key, params)

View Source

Specs

generate_secured_api_key!(api_key :: String.t(), params :: map()) :: binary()

Same as generate_secured_api_key/2 but returns the key or raises if invalid params

examples

Examples

Algoliax.generate_secured_api_key!("api_key", %{filters: "reference:10"})
Algoliax.generate_secured_api_key!("api_key", %{filters: "reference:10 OR nickname:john"})

Wait for a task to be published on Algolia side. Work with all indexer function except reindex_atomic/0

examples

Examples

MyApp.People.save_object(%MyApp.People{id: 1}) |> Algoliax.wait_task()