Skip to the content.

Analyzer API

These functions implement the HTTP API for manipulating Analyzers.

Note: Analyzers were introduced in ArangoDB 3.5 and are not supported by earlier versions of ArangoDB.

analyzer.exists

async analyzer.exists(): boolean

Checks whether the Analyzer exists.

Examples

const db = new Database();
const analyzer = db.analyzer("some-analyzer");
const result = await analyzer.exists();
// result indicates whether the Analyzer exists

analyzer.get

async analyzer.get(): Object

Retrieves the Analyzer definition for the Analyzer.

Examples

const db = new Database();
const analyzer = db.analyzer("some-analyzer");
const definition = await analyzer.get();
// definition contains the Analyzer definition

analyzer.create

async analyzer.create([options]): Object

Creates an Analyzer with the given options, then returns the new Analyzer definition.

Arguments

Examples

const db = new Database();
const analyzer = db.analyzer("potatoes");
await analyzer.create({ type: "identity" });
// the identity analyzer "potatoes" now exists

analyzer.drop

async analyzer.drop(): Object

Deletes the Analyzer from the database, then returns an object with the name of the Analyzer that was dropped.

Examples

const db = new Database();
const analyzer = db.analyzer("some-analyzer");
await analyzer.drop();
// the Analyzer "some-analyzer" no longer exists