Arangox.API.Analyzers (Arangox v0.8.0)

Copy Markdown View Source

ArangoDB's Analyzers operations.

Every function takes the pool as its first argument and returns the decoded response body. See Arangox.API.Client for the options they all accept and for what a 404 returns.

Summary

Functions

List all Analyzers

List all Analyzers. Raises on error.

Create an Analyzer

Create an Analyzer. Raises on error.

Remove an Analyzer. Raises on error.

Get an Analyzer definition

Get an Analyzer definition. Raises on error.

Functions

all(conn, opts \\ [])

@spec all(
  Arangox.conn(),
  keyword()
) :: {:ok, term()} | {:error, Exception.t()}

List all Analyzers

Retrieves a an array of all Analyzer definitions. The resulting array contains objects with the following attributes:

  • name: the Analyzer name
  • type: the Analyzer type
  • properties: the properties used to configure the specified type
  • features: the set of features to set on the Analyzer generated fields

Returns

Recorded against ArangoDB 3.12.10:

%{
  "code" => integer,
  "error" => boolean,
  "result" => [%{
    "features" => [string],
    "name" => string,
    "properties" => %{
      "accent" => boolean,
      "case" => string,
      "locale" => string,
      "stemming" => boolean,
      "stopwords" => []
    },
    "type" => string
  }]
}

all!(conn, opts \\ [])

@spec all!(
  Arangox.conn(),
  keyword()
) :: term()

List all Analyzers. Raises on error.

See all/1.

create(conn, body, opts \\ [])

@spec create(Arangox.conn(), term(), keyword()) ::
  {:ok, term()} | {:error, Exception.t()}

Create an Analyzer

Creates a new Analyzer based on the provided configuration.

create!(conn, body, opts \\ [])

@spec create!(Arangox.conn(), term(), keyword()) :: term()

Create an Analyzer. Raises on error.

See create/2.

delete(conn, analyzer_name, opts \\ [])

@spec delete(Arangox.conn(), binary(), keyword()) ::
  {:ok, term()} | {:error, Exception.t()}

Remove an Analyzer

Removes an Analyzer configuration identified by analyzer-name.

If the Analyzer definition was successfully dropped, an object is returned with the following attributes:

  • error: false
  • name: The name of the removed Analyzer

delete!(conn, analyzer_name, opts \\ [])

@spec delete!(Arangox.conn(), binary(), keyword()) :: term()

Remove an Analyzer. Raises on error.

See delete/2.

get(conn, analyzer_name, opts \\ [])

@spec get(Arangox.conn(), binary(), keyword()) ::
  {:ok, term()} | {:error, Exception.t()}

Get an Analyzer definition

Retrieves the full definition for the specified Analyzer name. The resulting object contains the following attributes:

  • name: the Analyzer name
  • type: the Analyzer type
  • properties: the properties used to configure the specified type
  • features: the set of features to set on the Analyzer generated fields

Returns

Recorded against ArangoDB 3.12.10:

%{
  "code" => integer,
  "error" => boolean,
  "features" => [],
  "name" => string,
  "properties" => %{},
  "type" => string
}

get!(conn, analyzer_name, opts \\ [])

@spec get!(Arangox.conn(), binary(), keyword()) :: term()

Get an Analyzer definition. Raises on error.

See get/2.