ExTypesense.Stopwords (ExTypesense v2.0.0)

View Source

Stopwords are keywords which will be removed from search query while searching.

During indexing

Stopwords are NOT dropped during indexing.

More here: https://typesense.org/docs/latest/api/stopwords.html

Summary

Functions

Permanently deletes a stopwords set, given it's name.

Retrieve the details of a stopwords set, given it's name.

Retrieves all stopwords sets.

Upserts a stopwords set.

Functions

delete_stopword(stop_id)

(since 1.0.0)
@spec delete_stopword(String.t()) ::
  {:ok, map()} | {:error, OpenApiTypesense.ApiResponse.t()}

Permanently deletes a stopwords set, given it's name.

delete_stopword(stop_id, opts)

(since 1.0.0)
@spec delete_stopword(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, OpenApiTypesense.ApiResponse.t()}

Same as delete_stopword/1

Options

  • conn: The custom connection map or struct you passed

Examples

iex> conn = %{api_key: xyz, host: ...}
iex> ExTypesense.delete_stopword("stopword_set_countries", conn: conn)

iex> conn = OpenApiTypesense.Connection.new()
iex> ExTypesense.delete_stopword("stopword_set_countries", conn: conn)

iex> opts = [conn: conn]
iex> ExTypesense.delete_stopword("stopword_set_countries", opts)

get_stopword(stop_id)

(since 1.0.0)

Retrieve the details of a stopwords set, given it's name.

get_stopword(stop_id, opts)

(since 1.0.0)

Same as get_stopword/1

Options

  • conn: The custom connection map or struct you passed

Examples

iex> conn = %{api_key: xyz, host: ...}
iex> ExTypesense.get_stopword("stopword_set_countries", conn: conn)

iex> conn = OpenApiTypesense.Connection.new()
iex> ExTypesense.get_stopword("stopword_set_countries", conn: conn)

iex> opts = [conn: conn]
iex> ExTypesense.get_stopword("stopword_set_countries", opts)

list_stopwords()

(since 1.0.0)
@spec list_stopwords() ::
  {:ok, OpenApiTypesense.StopwordsSetsRetrieveAllSchema.t()} | :error

Retrieves all stopwords sets.

list_stopwords(opts)

(since 1.0.0)
@spec list_stopwords(keyword()) ::
  {:ok, OpenApiTypesense.StopwordsSetsRetrieveAllSchema.t()} | :error

Same as list_stopwords/0

Options

  • conn: The custom connection map or struct you passed

Examples

iex> conn = %{api_key: xyz, host: ...}
iex> ExTypesense.list_stopwords(conn: conn)

iex> conn = OpenApiTypesense.Connection.new()
iex> ExTypesense.list_stopwords(conn: conn)

iex> opts = [conn: conn]
iex> ExTypesense.list_stopwords(opts)

upsert_stopword(stop_id, body)

(since 1.0.0)
@spec upsert_stopword(String.t(), map()) ::
  {:ok, OpenApiTypesense.StopwordsSetSchema.t()}
  | {:error, OpenApiTypesense.ApiResponse.t()}

Upserts a stopwords set.

Examples

iex> body = %{
...>   "stopwords" => [
...>     "Bustin Jieber",
...>     "Pelvis Presly",
...>     "Tinus Lorvalds",
...>     "Britney Smears"
...>   ],
...>   "locale" => "en"
...> }
iex> ExTypesense.upsert_override("stopwords-famous-person", body)

upsert_stopword(stop_id, body, opts)

(since 1.0.0)
@spec upsert_stopword(String.t(), map(), keyword()) ::
  {:ok, OpenApiTypesense.StopwordsSetSchema.t()}
  | {:error, OpenApiTypesense.ApiResponse.t()}

Same as upsert_stopword/2

Options

  • conn: The custom connection map or struct you passed

Examples

iex> conn = %{api_key: xyz, host: ...}
iex> ExTypesense.upsert_stopword("stopword_set_countries", body, conn: conn)

iex> conn = OpenApiTypesense.Connection.new()
iex> ExTypesense.upsert_stopword("stopword_set_countries", body, conn: conn)

iex> opts = [conn: conn]
iex> ExTypesense.upsert_stopword("stopword_set_countries", body, opts)