ArangoDB v3.5 reached End of Life (EOL) and is no longer supported.
This documentation is outdated. Please see the most recent version here: Latest Docs
HTTP Interface for Analyzers
The RESTful API for managing ArangoSearch Analyzers is accessible via the
/_api/analyzer
endpoint.
See the description of Analyzers for an introduction and the available types, properties and features.
Analyzer Operations
Create an analyzer with the suppiled definition
creates a new analyzer based on the provided definition
POST /_api/analyzer
A JSON object with these properties is required:
-
name: The analyzer name.
-
type: The analyzer type.
-
properties: The properties used to configure the specified type. Value may be a string, an object or null. The default value is null.
-
features: The set of features to set on the analyzer generated fields. The default value is an empty array.
Creates a new analyzer based on the provided configuration.
Return codes
-
200: An analyzer with a matching name and definition already exists.
-
201: A new analyzer definition was successfully created.
-
400: One or more of the required parameters is missing or one or more of the parameters is not valid.
-
403: The user does not have permission to create and analyzer with this configuration.
Examples
shell> curl -X POST --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/analyzer <<EOF
{
"name" : "testAnalyzer",
"type" : "identity"
}
EOF
HTTP/1.1 Created
content-type: application/json; charset=utf-8
x-content-type-options: nosniff
{
"name" : "_system::testAnalyzer",
"type" : "identity",
"properties" : {
},
"features" : [ ]
}
shell> curl -X POST --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/analyzer <<EOF
{
"name" : "testAnalyzer",
"type" : "identity"
}
EOF
HTTP/1.1 Created
content-type: application/json; charset=utf-8
x-content-type-options: nosniff
Return the analyzer definition
returns an analyzer definition
GET /_api/analyzer/{analyzer-name}
Path Parameters
- analyzer-name (required): The name of the analyzer to retrieve.
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
Return codes
-
200: The analyzer definition was retrieved successfully.
-
404: Such an analyzer configuration does not exist.
Examples
Retrieve an analyzer definition:
shell> curl --header 'accept: application/json' --dump - http://localhost:8529/_api/analyzer/testAnalyzer
HTTP/1.1 OK
content-type: application/json; charset=utf-8
x-content-type-options: nosniff
{
"error" : false,
"code" : 200,
"type" : "identity",
"properties" : {
},
"features" : [ ],
"name" : "_system::testAnalyzer"
}
shell> curl --header 'accept: application/json' --dump - http://localhost:8529/_api/analyzer/testAnalyzer
HTTP/1.1 OK
content-type: application/json; charset=utf-8
x-content-type-options: nosniff
List all analyzers
returns a listing of available analyzer definitions
GET /_api/analyzer
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
Return codes
- 200: The analyzer definitions was retrieved successfully.
Examples
Retrieve all analyzer definitions:
shell> curl --header 'accept: application/json' --dump - http://localhost:8529/_api/analyzer
HTTP/1.1 OK
content-type: application/json; charset=utf-8
x-content-type-options: nosniff
{
"error" : false,
"code" : 200,
"result" : [
{
"name" : "text_zh",
"type" : "text",
"properties" : {
"locale" : "zh.utf-8",
"case" : "lower",
"stopwords" : [ ],
"accent" : false,
"stemming" : true
},
"features" : [
"position",
"norm",
"frequency"
]
},
{
"name" : "text_sv",
"type" : "text",
"properties" : {
"locale" : "sv.utf-8",
"case" : "lower",
"stopwords" : [ ],
"accent" : false,
"stemming" : true
},
"features" : [
"position",
"norm",
"frequency"
]
},
{
"name" : "text_pt",
"type" : "text",
"properties" : {
"locale" : "pt.utf-8",
"case" : "lower",
"stopwords" : [ ],
"accent" : false,
"stemming" : true
},
"features" : [
"position",
"norm",
"frequency"
]
},
{
"name" : "text_nl",
"type" : "text",
"properties" : {
"locale" : "nl.utf-8",
"case" : "lower",
"stopwords" : [ ],
"accent" : false,
"stemming" : true
},
"features" : [
"position",
"norm",
"frequency"
]
},
{
"name" : "text_no",
"type" : "text",
"properties" : {
"locale" : "no.utf-8",
"case" : "lower",
"stopwords" : [ ],
"accent" : false,
"stemming" : true
},
"features" : [
"position",
"norm",
"frequency"
]
},
{
"name" : "text_de",
"type" : "text",
"properties" : {
"locale" : "de.utf-8",
"case" : "lower",
"stopwords" : [ ],
"accent" : false,
"stemming" : true
},
"features" : [
"position",
"norm",
"frequency"
]
},
{
"name" : "text_ru",
"type" : "text",
"properties" : {
"locale" : "ru.utf-8",
"case" : "lower",
"stopwords" : [ ],
"accent" : false,
"stemming" : true
},
"features" : [
"position",
"norm",
"frequency"
]
},
{
"name" : "identity",
"type" : "identity",
"properties" : {
},
"features" : [
"norm",
"frequency"
]
},
{
"name" : "text_en",
"type" : "text",
"properties" : {
"locale" : "en.utf-8",
"case" : "lower",
"stopwords" : [ ],
"accent" : false,
"stemming" : true
},
"features" : [
"position",
"norm",
"frequency"
]
},
{
"name" : "text_es",
"type" : "text",
"properties" : {
"locale" : "es.utf-8",
"case" : "lower",
"stopwords" : [ ],
"accent" : false,
"stemming" : true
},
"features" : [
"position",
"norm",
"frequency"
]
},
{
"name" : "text_it",
"type" : "text",
"properties" : {
"locale" : "it.utf-8",
"case" : "lower",
"stopwords" : [ ],
"accent" : false,
"stemming" : true
},
"features" : [
"position",
"norm",
"frequency"
]
},
{
"name" : "text_fr",
"type" : "text",
"properties" : {
"locale" : "fr.utf-8",
"case" : "lower",
"stopwords" : [ ],
"accent" : false,
"stemming" : true
},
"features" : [
"position",
"norm",
"frequency"
]
},
{
"name" : "text_fi",
"type" : "text",
"properties" : {
"locale" : "fi.utf-8",
"case" : "lower",
"stopwords" : [ ],
"accent" : false,
"stemming" : true
},
"features" : [
"position",
"norm",
"frequency"
]
}
]
}
shell> curl --header 'accept: application/json' --dump - http://localhost:8529/_api/analyzer
HTTP/1.1 OK
content-type: application/json; charset=utf-8
x-content-type-options: nosniff
Remove an analyzer
removes an analyzer configuration
DELETE /_api/analyzer/{analyzer-name}
Path Parameters
- analyzer-name (required): The name of the analyzer to remove.
Query Parameters
- force (optional): The analyzer configuration should be removed even if it is in-use. The default value is false.
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
Return codes
-
200: The analyzer configuration was removed successfully.
-
400: The analyzer-name was not supplied or another request parameter was not valid.
-
403: The user does not have permission to remove this analyzer configuration.
-
404: Such an analyzer configuration does not exist.
-
409: The specified analyzer configuration is still in use and force was omitted or false specified.
Examples
Removing without force:
shell> curl -X DELETE --header 'accept: application/json' --dump - http://localhost:8529/_api/analyzer/testAnalyzer
HTTP/1.1 OK
content-type: application/json; charset=utf-8
x-content-type-options: nosniff
{
"error" : false,
"code" : 200,
"name" : "_system::testAnalyzer"
}
shell> curl -X DELETE --header 'accept: application/json' --dump - http://localhost:8529/_api/analyzer/testAnalyzer
HTTP/1.1 OK
content-type: application/json; charset=utf-8
x-content-type-options: nosniff
Removing with force:
shell> curl -X POST --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/collection <<EOF
{
"name" : "testCollection"
}
EOF
shell> curl -X POST --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/view <<EOF
{
"name" : "testView",
"type" : "arangosearch",
"links" : {
"testCollection" : {
"analyzers" : [
"testAnalyzer"
]
}
}
}
EOF
shell> curl -X DELETE --header 'accept: application/json' --dump - http://localhost:8529/_api/analyzer/testAnalyzer?force=false
shell> curl -X DELETE --header 'accept: application/json' --dump - http://localhost:8529/_api/analyzer/testAnalyzer?force=true
HTTP/1.1 OK
content-type: application/json; charset=utf-8
x-content-type-options: nosniff
{
"error" : false,
"code" : 200,
"name" : "_system::testAnalyzer"
}
shell> curl -X POST --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/collection <<EOF
{
"name" : "testCollection"
}
EOF
shell> curl -X POST --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/view <<EOF
{
"name" : "testView",
"type" : "arangosearch",
"links" : {
"testCollection" : {
"analyzers" : [
"testAnalyzer"
]
}
}
}
EOF
shell> curl -X DELETE --header 'accept: application/json' --dump - http://localhost:8529/_api/analyzer/testAnalyzer?force=false
shell> curl -X DELETE --header 'accept: application/json' --dump - http://localhost:8529/_api/analyzer/testAnalyzer?force=true
HTTP/1.1 OK
content-type: application/json; charset=utf-8
x-content-type-options: nosniff