HTTP interface for Analyzers

The HTTP API for Analyzers lets you create and delete Analyzers, as well as list all or get specific Analyzers with all their settings

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.

Create an Analyzer

POST /_db/{database-name}/_api/analyzer
Creates a new Analyzer based on the provided configuration.
Path Parameters
  • The name of the database.

Query Parameters
    HTTP Headers
      Request Body application/json object
      • The set of features to set on the Analyzer generated fields. The default value is an empty array.

      • The Analyzer name.

      • The properties used to configure the specified Analyzer type.

      • The Analyzer type.

      Responses
      • An Analyzer with a matching name and definition already exists.

      • A new Analyzer definition was successfully created.

      • One or more of the required parameters is missing or one or more of the parameters is not valid.

      • The user does not have permission to create and Analyzer with this configuration.

      Examples

      curl -X POST --header 'accept: application/json' --data-binary @- --dump - 'http://localhost:8529/_api/analyzer' <<'EOF'
      {
        "name": "testAnalyzer",
        "type": "identity"
      }
      EOF
      Show output

      Get an Analyzer definition

      GET /_db/{database-name}/_api/analyzer/{analyzer-name}

      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
      Path Parameters
      • The name of the database.

      • The name of the Analyzer to retrieve.

      Query Parameters
        HTTP Headers
          Responses
          • The Analyzer definition was retrieved successfully.

          • Such an Analyzer configuration does not exist.

          Examples

          Retrieve an Analyzer definition:

          curl --header 'accept: application/json' --dump - 'http://localhost:8529/_api/analyzer/testAnalyzer'
          Show output

          List all Analyzers

          GET /_db/{database-name}/_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
          Path Parameters
          • The name of the database.

          Query Parameters
            HTTP Headers
              Responses
              • The Analyzer definitions was retrieved successfully.

              Examples

              Retrieve all Analyzer definitions:

              curl --header 'accept: application/json' --dump - 'http://localhost:8529/_api/analyzer'
              Show output

              Remove an Analyzer

              DELETE /_db/{database-name}/_api/analyzer/{analyzer-name}

              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
              Path Parameters
              • The name of the database.

              • The name of the Analyzer to remove.

              Query Parameters
              • The Analyzer configuration should be removed even if it is in-use. The default value is false.

              HTTP Headers
                Responses
                • The Analyzer configuration was removed successfully.

                • The analyzer-name was not supplied or another request parameter was not valid.

                • The user does not have permission to remove this Analyzer configuration.

                • Such an Analyzer configuration does not exist.

                • The specified Analyzer configuration is still in use and force was omitted or false specified.

                Examples

                Removing without force:

                curl -X DELETE --header 'accept: application/json' --dump - 'http://localhost:8529/_api/analyzer/testAnalyzer'
                Show output

                Removing with force:

                curl -X POST --header 'accept: application/json' --data-binary @- --dump - 'http://localhost:8529/_api/collection' <<'EOF'
                {
                  "name": "testCollection"
                }
                EOF
                
                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
                
                curl -X DELETE --header 'accept: application/json' --dump - 'http://localhost:8529/_api/analyzer/testAnalyzer?force=false'
                
                curl -X DELETE --header 'accept: application/json' --dump - 'http://localhost:8529/_api/analyzer/testAnalyzer?force=true'
                Show output