View Source Meilisearch.Settings (meilisearch_ex v1.1.2)

Customize settings for your Meilisearch indexes. Search API

Link to this section Summary

Functions

Get settings of an Index of your Meilisearch instance. Meilisearch documentation

Reset settings of an Index in your Meilisearch instance. Meilisearch documentation

Update settings of an Index in your Meilisearch instance. Meilisearch documentation

Link to this section Types

@type t() :: %Meilisearch.Settings{
  displayedAttributes: [String.t()],
  distinctAttribute: String.t() | nil,
  faceting: Meilisearch.Settings.Faceting.t(),
  filterableAttributes: [String.t()],
  pagination: Meilisearch.Settings.Pagination.t(),
  rankingRules: [String.t()],
  searchableAttributes: [String.t()],
  sortableAttributes: [String.t()],
  stopWords: [String.t()],
  synonyms: map(),
  typoTolerance: Meilisearch.Settings.TypeTolerance.t()
}

Link to this section Functions

@spec get(Tesla.Client.t(), String.t()) ::
  {:ok, t()} | {:error, Meilisearch.Client.error()}

Get settings of an Index of your Meilisearch instance. Meilisearch documentation

examples

Examples

iex> client = Meilisearch.Client.new(endpoint: "http://localhost:7700", key: "master_key_test")
iex> Meilisearch.Settings.get(client, "movies")
{:ok, %{
  uid: "movies",
  primaryKey: "id",
  createdAt: ~U[2021-08-12 10:00:00],
  updatedAt: ~U[2021-08-12 10:00:00]
}}
Link to this function

reset(client, index_uid)

View Source

Reset settings of an Index in your Meilisearch instance. Meilisearch documentation

examples

Examples

iex> client = Meilisearch.Client.new(endpoint: "http://localhost:7700", key: "master_key_test")
iex> Meilisearch.Settings.reset(client, "movies")
{:ok, %{
  taskUid: 0,
  indexUid: "movies",
  status: :enqueued,
  type: :settingsUpdate,
  enqueuedAt: ~U[2021-08-12 10:00:00]
}}
Link to this function

update(client, index_uid, params)

View Source
@spec update(Tesla.Client.t(), String.t(), t()) ::
  {:ok, Meilisearch.SummarizedTask.t()} | {:error, Meilisearch.Client.error()}

Update settings of an Index in your Meilisearch instance. Meilisearch documentation

examples

Examples

iex> client = Meilisearch.Client.new(endpoint: "http://localhost:7700", key: "master_key_test")
iex> Meilisearch.Settings.update(client, "movies", %{displayedAttributes: ["title"]})
{:ok, %{
  taskUid: 0,
  indexUid: "movies",
  status: :enqueued,
  type: :settingsUpdate,
  enqueuedAt: ~U[2021-08-12 10:00:00]
}}