HTTP interface for arangosearch Views

The HTTP API for Views lets you manage arangosearch Views, including handling the general View properties and View links

Create an arangosearch View

POST /_db/{database-name}/_api/view
Creates a new View with a given name and properties if it does not already exist.
Path Parameters
  • The name of the database.

Query Parameters
    HTTP Headers
      Request Body application/json object
      • Wait at least this many commits between removing unused files in the ArangoSearch data directory (0 = disable). For the case where the consolidation policies merge segments often (i.e. a lot of commit+consolidate), a lower value causes a lot of disk space to be wasted. For the case where the consolidation policies rarely merge segments (i.e. few inserts/deletes), a higher value impacts performance without any added benefits.

        Background: With every “commit” or “consolidate” operation, a new state of the View’s internal data structures is created on disk. Old states/snapshots are released once there are no longer any users remaining. However, the files for the released states/snapshots are left on disk, and only removed by “cleanup” operation.

      • Wait at least this many milliseconds between committing View data store changes and making documents visible to queries (0 = disable). For the case where there are a lot of inserts/updates, a higher value causes the index not to account for them and memory usage continues to grow until the commit. A lower value impacts performance, including the case where there are no or only a few inserts/updates because of synchronous locking, and it wastes disk space for each commit call.

        Background: For data retrieval, ArangoSearch follows the concept of “eventually-consistent”, i.e. eventually all the data in ArangoDB will be matched by corresponding query expressions. The concept of ArangoSearch “commit” operations is introduced to control the upper-bound on the time until document addition/removals are actually reflected by corresponding query expressions. Once a “commit” operation is complete, all documents added/removed prior to the start of the “commit” operation will be reflected by queries invoked in subsequent ArangoDB transactions, in-progress ArangoDB transactions will still continue to return a repeatable-read state.

      • Wait at least this many milliseconds between applying consolidationPolicy to consolidate the View data store and possibly release space on the filesystem (0 = disable). For the case where there are a lot of data modification operations, a higher value could potentially have the data store consume more space and file handles. For the case where there are a few data modification operations, a lower value impacts performance due to no segment candidates being available for consolidation.

        Background: For data modification, ArangoSearch follows the concept of a “versioned data store”. Thus old versions of data may be removed once there are no longer any users of the old data. The frequency of the cleanup and compaction operations are governed by consolidationIntervalMsec and the candidates for compaction are selected via consolidationPolicy.

      • The consolidation policy to apply for selecting which segments should be merged.

        • If the tier type is used, then the segments* and minScore properties are available.
        • If the bytes_accum type is used, then the threshold property is available.

        Background: With each ArangoDB transaction that inserts documents, one or more ArangoSearch-internal segments get created. Similarly, for removed documents, the segments that contain such documents have these documents marked as ‘deleted’. Over time, this approach causes a lot of small and sparse segments to be created. A “consolidation” operation selects one or more segments and copies all of their valid documents into a single new segment, thereby allowing the search algorithm to perform more optimally and for extra file handles to be released once old segments are no longer used.

        • Filter out consolidation candidates with a score less than this.

        • Defines the value (in bytes) to treat all smaller segments as equal for consolidation selection.

        • Maximum allowed size of all consolidated segments in bytes.

        • The maximum number of segments that are evaluated as candidates for consolidation.

        • The minimum number of segments that are evaluated as candidates for consolidation

        • A value in the range [0.0, 1.0].

        • The segment candidates for the “consolidation” operation are selected based upon several possible configurable formulas as defined by their types. The currently supported types are:

          • "tier": consolidate based on segment byte size and live document count as dictated by the customization attributes.
          • "bytes_accum": consolidate if and only if {threshold} > (segment_bytes + sum_of_merge_candidate_segment_bytes) / all_segment_bytes i.e. the sum of all candidate segment byte size is less than the total segment byte size multiplied by the {threshold}.

          Possible values: "tier", "bytes_accum"

      • The name of the View.

      • An array of strings defining sort expressions that you want to optimize. This is also known as WAND optimization (introduced in v3.12.0).

        This option is immutable.

        If you query a View with the SEARCH operation in combination with a SORT and LIMIT operation, search results can be retrieved faster if the SORT expression matches one of the optimized expressions.

        Only sorting by highest rank is supported, that is, sorting by the result of a scoring function in descending order (DESC). Use @doc in the expression where you would normally pass the document variable emitted by the SEARCH operation to the scoring function.

        You can define up to 64 expressions per View.

        Example: ["BM25(@doc) DESC", "TFIDF(@doc, true) DESC"]

        This property is available in the Enterprise Edition only.

      • If you enable this option, then the primary key columns are always cached in memory (introduced in v3.9.6, Enterprise Edition only). This can improve the performance of queries that return many documents. Otherwise, these values are memory-mapped and it is up to the operating system to load them from disk into memory and to evict them from memory.

        This option is immutable.

        See the --arangosearch.columns-cache-limit startup option to control the memory consumption of this cache. You can reduce the memory usage of the column cache in cluster deployments by only using the cache for leader shards, see the --arangosearch.columns-cache-only-leader startup option (introduced in v3.10.6).

      • You can define a primary sort order to enable an AQL optimization. If a query iterates over all documents of a View, wants to sort them by attribute values and the (left-most) fields to sort by as well as their sorting direction match with the primarySort definition, then the SORT operation is optimized away. This option is immutable.

        Expects an array of objects, each specifying a field (attribute path) and a sort direction: [ { "field": "attr", "direction": "asc"}, … ]

        • The sort direction.

          • "asc" for ascending
          • "desc" for descending

          Possible values: "asc", "desc"

        • An attribute path. The . character denotes sub-attributes.

      • If you enable this option, then the primary sort columns are always cached in memory (Enterprise Edition only). This can improve the performance of queries that utilize the primary sort order. Otherwise, these values are memory-mapped and it is up to the operating system to load them from disk into memory and to evict them from memory.

        This option is immutable.

        See the --arangosearch.columns-cache-limit startup option to control the memory consumption of this cache. You can reduce the memory usage of the column cache in cluster deployments by only using the cache for leader shards, see the --arangosearch.columns-cache-only-leader startup option.

      • Defines how to compress the primary sort data.

        • "lz4": use LZ4 fast compression.
        • "none": disable compression to trade space for speed.

        This option is immutable.

        Possible values: "lz4", "none"

      • An array of objects to describe which document attributes to store in the View index. It can then cover search queries, which means the data can be taken from the index directly and accessing the storage engine can be avoided.

        This option is immutable.

        Each object is expected in the following form:

        { "fields": [ "attr1", "attr2", ... "attrN" ], "compression": "none", "cache": false }

        You may use the following shorthand notations on View creation instead of an array of objects as described above. The default compression and cache settings are used in this case:

        • An array of strings, like ["attr1", "attr2"], to place each attribute into a separate column of the index.

        • An array of arrays of strings, like [["attr1", "attr2"]], to place the attributes into a single column of the index, or [["attr1"], ["attr2"]] to place each attribute into a separate column. You can also mix it with the full form:

          [
            ["attr1"],
            ["attr2", "attr3"],
            { "fields": ["attr4", "attr5"], "cache": true }
          ]
          

        The storedValues option is not to be confused with the storeValues option, which allows to store meta data about attribute values in the View index.

        • Whether to always cache stored values in memory (Enterprise Edition only). This can improve the query performance if stored values are involved. Otherwise, these values are memory-mapped and it is up to the operating system to load them from disk into memory and to evict them from memory.

          See the --arangosearch.columns-cache-limit startup option to control the memory consumption of this cache. You can reduce the memory usage of the column cache in cluster deployments by only using the cache for leader shards, see the --arangosearch.columns-cache-only-leader startup option.

        • Defines the compression type used for the internal column-store.

          • "lz4": LZ4 fast compression
          • "none": no compression

          Possible values: "lz4", "none"

        • An array of strings with one or more document attribute paths. The specified attributes are placed into a single column of the index. A column with all fields that are involved in common search queries is ideal for performance. The column should not include too many unneeded fields, however.

      • The type of the View. Must be equal to "arangosearch". This option is immutable.

      • Maximum number of concurrent active writers (segments) that perform a transaction. Other writers (segments) wait till current active writers (segments) finish (immutable, 0 = disable).

      • Maximum number of writers (segments) cached in the pool (immutable, 0 = disable).

      • Maximum memory byte size per writer (segment) before a writer (segment) flush is triggered. The value 0 turns off this limit for any writer (buffer) and data is flushed periodically based on the value defined for the flush thread (ArangoDB server startup option). This should be used carefully due to high potential memory consumption (immutable, 0 = disable).

      Responses
      • The View has been created.

          Response Body application/json object
        • Wait at least this many commits between removing unused files in the ArangoSearch data directory (0 = disabled).

        • Wait at least this many milliseconds between committing View data store changes and making documents visible to queries (0 = disabled).

        • Wait at least this many milliseconds between applying consolidationPolicy to consolidate the View data store and possibly release space on the filesystem (0 = disabled).

        • The consolidation policy to apply for selecting which segments should be merged.

          • If the tier type is used, then the segments* and minScore properties are available.
          • If the bytes_accum type is used, then the threshold property is available.

          • Filter out consolidation candidates with a score less than this.

          • Defines the value (in bytes) to treat all smaller segments as equal for consolidation selection.

          • Maximum allowed size of all consolidated segments in bytes.

          • The maximum number of segments that are evaluated as candidates for consolidation.

          • The minimum number of segments that are evaluated as candidates for consolidation

          • A value in the range [0.0, 1.0]

          • The segment candidates for the “consolidation” operation are selected based upon several possible configurable formulas as defined by their types. The currently supported types are:

            • "tier": consolidate based on segment byte size and live document count as dictated by the customization attributes.
            • "bytes_accum": consolidate if and only if {threshold} > (segment_bytes + sum_of_merge_candidate_segment_bytes) / all_segment_bytes i.e. the sum of all candidate segment byte size is less than the total segment byte size multiplied by the {threshold}.

            Possible values: "tier", "bytes_accum"

        • A unique identifier of the View. This is an internal property.

        • A unique identifier of the View (deprecated).

        • The name of the View.

        • An array of strings defining sort expressions that can be optimized. This is also known as WAND optimization (Enterprise Edition only, introduced in v3.12.0).

        • Whether the primary key columns are always cached in memory (Enterprise Edition only).

        • The primary sort order, described by an array of objects, each specifying a field (attribute path) and a sort direction.

          • The sort direction.

            • true for ascending
            • false for descending

          • An attribute path. The . character denotes sub-attributes.

        • Whether the primary sort columns are always cached in memory (Enterprise Edition only).

        • Defines how the primary sort data is compressed.

          • "lz4": LZ4 fast compression
          • "none": no compression

          Possible values: "lz4", "none"

        • An array of objects that describes which document attributes are stored in the View index for covering search queries, which means the data can be taken from the index directly and accessing the storage engine can be avoided.

          • Whether stored values are always cached in memory (Enterprise Edition only).

          • The compression type used for the internal column-store.

            • "lz4": LZ4 fast compression
            • "none": no compression

            Possible values: "lz4", "none"

          • An array of strings with one or more document attribute paths.

        • The type of the View ("arangosearch").

        • Maximum number of concurrent active writers (segments) that perform a transaction. Other writers (segments) wait till current active writers (segments) finish (0 = disabled).

        • Maximum number of writers (segments) cached in the pool (0 = disabled).

        • Maximum memory byte size per writer (segment) before a writer (segment) flush is triggered. 0 value turns off this limit for any writer (buffer) and data is flushed periodically based on the value defined for the flush thread (0 = disabled).

      • The name or type attribute is missing or invalid.

          Response Body application/json object
        • The HTTP response status code.

        • A flag indicating that an error occurred.

        • A descriptive error message.

        • ArangoDB error number for the error that occurred.

      • A View called name already exists.

          Response Body application/json object
        • The HTTP response status code.

        • A flag indicating that an error occurred.

        • A descriptive error message.

        • ArangoDB error number for the error that occurred.

      Examples

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

      Get information about a View

      GET /_db/{database-name}/_api/view/{view-name}
      Returns the basic information about a specific View.
      Path Parameters
      • The name of the database.

      • The name of the View.

      Query Parameters
        HTTP Headers
          Responses
          • The basic information about the View.

              Response Body application/json object
            • The HTTP response status code.

            • A flag indicating that no error occurred.

            • A unique identifier of the View. This is an internal property.

            • A unique identifier of the View (deprecated).

            • The name of the View.

            • The type of the View ("arangosearch").

          • A View called view-name could not be found.

              Response Body application/json object
            • The HTTP response status code.

            • A flag indicating that an error occurred.

            • A descriptive error message.

            • ArangoDB error number for the error that occurred.

          Examples

          Using an identifier:

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

          Using a name:

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

          Get the properties of a View

          GET /_db/{database-name}/_api/view/{view-name}/properties
          Returns an object containing the definition of the View identified by view-name.
          Path Parameters
          • The name of the database.

          • The name of the View.

          Query Parameters
            HTTP Headers
              Responses
              • An object with a full description of the specified View, including arangosearch View type-dependent properties.

                  Response Body application/json object
                • Wait at least this many commits between removing unused files in the ArangoSearch data directory (0 = disabled).

                • The HTTP response status code.

                • Wait at least this many milliseconds between committing View data store changes and making documents visible to queries (0 = disabled).

                • Wait at least this many milliseconds between applying consolidationPolicy to consolidate the View data store and possibly release space on the filesystem (0 = disabled).

                • The consolidation policy to apply for selecting which segments should be merged.

                  • If the tier type is used, then the segments* and minScore properties are available.
                  • If the bytes_accum type is used, then the threshold property is available.

                  • Filter out consolidation candidates with a score less than this.

                  • Defines the value (in bytes) to treat all smaller segments as equal for consolidation selection.

                  • Maximum allowed size of all consolidated segments in bytes.

                  • The maximum number of segments that are evaluated as candidates for consolidation.

                  • The minimum number of segments that are evaluated as candidates for consolidation

                  • A value in the range [0.0, 1.0]

                  • The segment candidates for the “consolidation” operation are selected based upon several possible configurable formulas as defined by their types. The currently supported types are:

                    • "tier": consolidate based on segment byte size and live document count as dictated by the customization attributes.
                    • "bytes_accum": consolidate if and only if {threshold} > (segment_bytes + sum_of_merge_candidate_segment_bytes) / all_segment_bytes i.e. the sum of all candidate segment byte size is less than the total segment byte size multiplied by the {threshold}.

                    Possible values: "tier", "bytes_accum"

                • A flag indicating that no error occurred.

                • A unique identifier of the View. This is an internal property.

                • A unique identifier of the View (deprecated).

                • The name of the View.

                • An array of strings defining sort expressions that can be optimized. This is also known as WAND optimization (Enterprise Edition only, introduced in v3.12.0).

                • Whether the primary key columns are always cached in memory (Enterprise Edition only).

                • The primary sort order, described by an array of objects, each specifying a field (attribute path) and a sort direction.

                  • The sort direction.

                    • true for ascending
                    • false for descending

                  • An attribute path. The . character denotes sub-attributes.

                • Whether the primary sort columns are always cached in memory (Enterprise Edition only).

                • Defines how the primary sort data is compressed.

                  • "lz4": LZ4 fast compression
                  • "none": no compression

                  Possible values: "lz4", "none"

                • An array of objects that describes which document attributes are stored in the View index for covering search queries, which means the data can be taken from the index directly and accessing the storage engine can be avoided.

                  • Whether stored values are always cached in memory (Enterprise Edition only).

                  • The compression type used for the internal column-store.

                    • "lz4": LZ4 fast compression
                    • "none": no compression

                    Possible values: "lz4", "none"

                  • An array of strings with one or more document attribute paths.

                • The type of the View ("arangosearch").

                • Maximum number of concurrent active writers (segments) that perform a transaction. Other writers (segments) wait till current active writers (segments) finish (0 = disabled).

                • Maximum number of writers (segments) cached in the pool (0 = disabled).

                • Maximum memory byte size per writer (segment) before a writer (segment) flush is triggered. 0 value turns off this limit for any writer (buffer) and data is flushed periodically based on the value defined for the flush thread (0 = disabled).

              • The view-name path parameter is missing or invalid.

                  Response Body application/json object
                • The HTTP response status code.

                • A flag indicating that an error occurred.

                • A descriptive error message.

                • ArangoDB error number for the error that occurred.

              • A View called view-name could not be found.

                  Response Body application/json object
                • The HTTP response status code.

                • A flag indicating that an error occurred.

                • A descriptive error message.

                • ArangoDB error number for the error that occurred.

              Examples

              Using an identifier:

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

              Using a name:

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

              List all Views

              GET /_db/{database-name}/_api/view
              Returns an object containing a listing of all Views in the current database, regardless of their type.
              Path Parameters
              • The name of the database.

              Query Parameters
                HTTP Headers
                  Responses
                  • The list of Views.

                      Response Body application/json object
                    • The HTTP response status code.

                    • A flag indicating that no error occurred.

                    • The result object.

                      • A unique identifier of the View. This is an internal property.

                      • A unique identifier of the View (deprecated).

                      • The name of the View.

                      • The type of the View.

                        Possible values: "arangosearch", "search-alias"

                  Examples

                  Return information about all Views:

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

                  Replace the properties of an arangosearch View

                  PUT /_db/{database-name}/_api/view/{view-name}/properties
                  Changes all properties of a View by replacing them, except for immutable properties.
                  Path Parameters
                  • The name of the database.

                  • The name of the View.

                  Query Parameters
                    HTTP Headers
                      Request Body application/json object
                      • Wait at least this many commits between removing unused files in the ArangoSearch data directory (0 = disable). For the case where the consolidation policies merge segments often (i.e. a lot of commit+consolidate), a lower value causes a lot of disk space to be wasted. For the case where the consolidation policies rarely merge segments (i.e. few inserts/deletes), a higher value impacts performance without any added benefits.

                        Background: With every “commit” or “consolidate” operation, a new state of the View’s internal data structures is created on disk. Old states/snapshots are released once there are no longer any users remaining. However, the files for the released states/snapshots are left on disk, and only removed by “cleanup” operation.

                      • Wait at least this many milliseconds between committing View data store changes and making documents visible to queries (0 = disable). For the case where there are a lot of inserts/updates, a higher value causes the index not to account for them and memory usage continues to grow until the commit. A lower value impacts performance, including the case where there are no or only a few inserts/updates because of synchronous locking, and it wastes disk space for each commit call.

                        Background: For data retrieval, ArangoSearch follows the concept of “eventually-consistent”, i.e. eventually all the data in ArangoDB will be matched by corresponding query expressions. The concept of ArangoSearch “commit” operations is introduced to control the upper-bound on the time until document addition/removals are actually reflected by corresponding query expressions. Once a “commit” operation is complete, all documents added/removed prior to the start of the “commit” operation will be reflected by queries invoked in subsequent ArangoDB transactions, in-progress ArangoDB transactions will still continue to return a repeatable-read state.

                      • Wait at least this many milliseconds between applying consolidationPolicy to consolidate the View data store and possibly release space on the filesystem (0 = disable). For the case where there are a lot of data modification operations, a higher value could potentially have the data store consume more space and file handles. For the case where there are a few data modification operations, a lower value impacts performance due to no segment candidates being available for consolidation.

                        Background: For data modification, ArangoSearch follows the concept of a “versioned data store”. Thus old versions of data may be removed once there are no longer any users of the old data. The frequency of the cleanup and compaction operations are governed by consolidationIntervalMsec and the candidates for compaction are selected via consolidationPolicy.

                      • The consolidation policy to apply for selecting which segments should be merged.

                        • If the tier type is used, then the segments* and minScore properties are available.
                        • If the bytes_accum type is used, then the threshold property is available.

                        Background: With each ArangoDB transaction that inserts documents, one or more ArangoSearch-internal segments get created. Similarly, for removed documents, the segments that contain such documents have these documents marked as ‘deleted’. Over time, this approach causes a lot of small and sparse segments to be created. A “consolidation” operation selects one or more segments and copies all of their valid documents into a single new segment, thereby allowing the search algorithm to perform more optimally and for extra file handles to be released once old segments are no longer used.

                        • Filter out consolidation candidates with a score less than this.

                        • Defines the value (in bytes) to treat all smaller segments as equal for consolidation selection.

                        • Maximum allowed size of all consolidated segments in bytes.

                        • The maximum number of segments that are evaluated as candidates for consolidation.

                        • The minimum number of segments that are evaluated as candidates for consolidation

                        • A value in the range [0.0, 1.0].

                        • The segment candidates for the “consolidation” operation are selected based upon several possible configurable formulas as defined by their types. The currently supported types are:

                          • "tier": consolidate based on segment byte size and live document count as dictated by the customization attributes.
                          • "bytes_accum": consolidate if and only if {threshold} > (segment_bytes + sum_of_merge_candidate_segment_bytes) / all_segment_bytes i.e. the sum of all candidate segment byte size is less than the total segment byte size multiplied by the {threshold}.

                          Possible values: "tier", "bytes_accum"

                      Responses
                      • The View has been updated successfully.

                          Response Body application/json object
                        • Wait at least this many commits between removing unused files in the ArangoSearch data directory (0 = disabled).

                        • Wait at least this many milliseconds between committing View data store changes and making documents visible to queries (0 = disabled).

                        • Wait at least this many milliseconds between applying consolidationPolicy to consolidate the View data store and possibly release space on the filesystem (0 = disabled).

                        • The consolidation policy to apply for selecting which segments should be merged.

                          • If the tier type is used, then the segments* and minScore properties are available.
                          • If the bytes_accum type is used, then the threshold property is available.

                          • Filter out consolidation candidates with a score less than this.

                          • Defines the value (in bytes) to treat all smaller segments as equal for consolidation selection.

                          • Maximum allowed size of all consolidated segments in bytes.

                          • The maximum number of segments that are evaluated as candidates for consolidation.

                          • The minimum number of segments that are evaluated as candidates for consolidation

                          • A value in the range [0.0, 1.0]

                          • The segment candidates for the “consolidation” operation are selected based upon several possible configurable formulas as defined by their types. The currently supported types are:

                            • "tier": consolidate based on segment byte size and live document count as dictated by the customization attributes.
                            • "bytes_accum": consolidate if and only if {threshold} > (segment_bytes + sum_of_merge_candidate_segment_bytes) / all_segment_bytes i.e. the sum of all candidate segment byte size is less than the total segment byte size multiplied by the {threshold}.

                            Possible values: "tier", "bytes_accum"

                        • A unique identifier of the View. This is an internal property.

                        • A unique identifier of the View (deprecated).

                        • The name of the View.

                        • An array of strings defining sort expressions that can be optimized. This is also known as WAND optimization (Enterprise Edition only, introduced in v3.12.0).

                        • Whether the primary key columns are always cached in memory (Enterprise Edition only).

                        • The primary sort order, described by an array of objects, each specifying a field (attribute path) and a sort direction.

                          • The sort direction.

                            • true for ascending
                            • false for descending

                          • An attribute path. The . character denotes sub-attributes.

                        • Whether the primary sort columns are always cached in memory (Enterprise Edition only).

                        • Defines how the primary sort data is compressed.

                          • "lz4": LZ4 fast compression
                          • "none": no compression

                          Possible values: "lz4", "none"

                        • An array of objects that describes which document attributes are stored in the View index for covering search queries, which means the data can be taken from the index directly and accessing the storage engine can be avoided.

                          • Whether stored values are always cached in memory (Enterprise Edition only).

                          • The compression type used for the internal column-store.

                            • "lz4": LZ4 fast compression
                            • "none": no compression

                            Possible values: "lz4", "none"

                          • An array of strings with one or more document attribute paths.

                        • The type of the View ("arangosearch").

                        • Maximum number of concurrent active writers (segments) that perform a transaction. Other writers (segments) wait till current active writers (segments) finish (0 = disabled).

                        • Maximum number of writers (segments) cached in the pool (0 = disabled).

                        • Maximum memory byte size per writer (segment) before a writer (segment) flush is triggered. 0 value turns off this limit for any writer (buffer) and data is flushed periodically based on the value defined for the flush thread (0 = disabled).

                      • The view-name path parameter is missing or invalid.

                          Response Body application/json object
                        • The HTTP response status code.

                        • A flag indicating that an error occurred.

                        • A descriptive error message.

                        • ArangoDB error number for the error that occurred.

                      • A View called view-name could not be found.

                          Response Body application/json object
                        • The HTTP response status code.

                        • A flag indicating that an error occurred.

                        • A descriptive error message.

                        • ArangoDB error number for the error that occurred.

                      Examples

                      curl -X PUT --header 'accept: application/json' --data-binary @- --dump - 'http://localhost:8529/_api/view/productsView/properties' <<'EOF'
                      {
                        "locale": "en"
                      }
                      EOF
                      Show output

                      Update the properties of an arangosearch View

                      PATCH /_db/{database-name}/_api/view/{view-name}/properties
                      Partially changes the properties of a View by updating the specified attributes.
                      Path Parameters
                      • The name of the database.

                      • The name of the View.

                      Query Parameters
                        HTTP Headers
                          Request Body application/json object
                          • Wait at least this many commits between removing unused files in the ArangoSearch data directory (0 = disable). For the case where the consolidation policies merge segments often (i.e. a lot of commit+consolidate), a lower value causes a lot of disk space to be wasted. For the case where the consolidation policies rarely merge segments (i.e. few inserts/deletes), a higher value impacts performance without any added benefits.

                            Background: With every “commit” or “consolidate” operation, a new state of the View’s internal data structures is created on disk. Old states/snapshots are released once there are no longer any users remaining. However, the files for the released states/snapshots are left on disk, and only removed by “cleanup” operation.

                          • Wait at least this many milliseconds between committing View data store changes and making documents visible to queries (0 = disable). For the case where there are a lot of inserts/updates, a higher value causes the index not to account for them and memory usage continues to grow until the commit. A lower value impacts performance, including the case where there are no or only a few inserts/updates because of synchronous locking, and it wastes disk space for each commit call.

                            Background: For data retrieval, ArangoSearch follows the concept of “eventually-consistent”, i.e. eventually all the data in ArangoDB will be matched by corresponding query expressions. The concept of ArangoSearch “commit” operations is introduced to control the upper-bound on the time until document addition/removals are actually reflected by corresponding query expressions. Once a “commit” operation is complete, all documents added/removed prior to the start of the “commit” operation will be reflected by queries invoked in subsequent ArangoDB transactions, in-progress ArangoDB transactions will still continue to return a repeatable-read state.

                          • Wait at least this many milliseconds between applying consolidationPolicy to consolidate the View data store and possibly release space on the filesystem (0 = disable). For the case where there are a lot of data modification operations, a higher value could potentially have the data store consume more space and file handles. For the case where there are a few data modification operations, a lower value impacts performance due to no segment candidates being available for consolidation.

                            Background: For data modification, ArangoSearch follows the concept of a “versioned data store”. Thus old versions of data may be removed once there are no longer any users of the old data. The frequency of the cleanup and compaction operations are governed by consolidationIntervalMsec and the candidates for compaction are selected via consolidationPolicy.

                          • The consolidation policy to apply for selecting which segments should be merged.

                            • If the tier type is used, then the segments* and minScore properties are available.
                            • If the bytes_accum type is used, then the threshold property is available.

                            Background: With each ArangoDB transaction that inserts documents, one or more ArangoSearch-internal segments get created. Similarly, for removed documents, the segments that contain such documents have these documents marked as ‘deleted’. Over time, this approach causes a lot of small and sparse segments to be created. A “consolidation” operation selects one or more segments and copies all of their valid documents into a single new segment, thereby allowing the search algorithm to perform more optimally and for extra file handles to be released once old segments are no longer used.

                            • Filter out consolidation candidates with a score less than this.

                            • Defines the value (in bytes) to treat all smaller segments as equal for consolidation selection.

                            • Maximum allowed size of all consolidated segments in bytes.

                            • The maximum number of segments that are evaluated as candidates for consolidation.

                            • The minimum number of segments that are evaluated as candidates for consolidation

                            • A value in the range [0.0, 1.0].

                            • The segment candidates for the “consolidation” operation are selected based upon several possible configurable formulas as defined by their types. The currently supported types are:

                              • "tier": consolidate based on segment byte size and live document count as dictated by the customization attributes.
                              • "bytes_accum": consolidate if and only if {threshold} > (segment_bytes + sum_of_merge_candidate_segment_bytes) / all_segment_bytes i.e. the sum of all candidate segment byte size is less than the total segment byte size multiplied by the {threshold}.

                              Possible values: "tier", "bytes_accum"

                          Responses
                          • The View has been updated successfully.

                              Response Body application/json object
                            • Wait at least this many commits between removing unused files in the ArangoSearch data directory (0 = disabled).

                            • Wait at least this many milliseconds between committing View data store changes and making documents visible to queries (0 = disabled).

                            • Wait at least this many milliseconds between applying consolidationPolicy to consolidate the View data store and possibly release space on the filesystem (0 = disabled).

                            • The consolidation policy to apply for selecting which segments should be merged.

                              • If the tier type is used, then the segments* and minScore properties are available.
                              • If the bytes_accum type is used, then the threshold property is available.

                              • Filter out consolidation candidates with a score less than this.

                              • Defines the value (in bytes) to treat all smaller segments as equal for consolidation selection.

                              • Maximum allowed size of all consolidated segments in bytes.

                              • The maximum number of segments that are evaluated as candidates for consolidation.

                              • The minimum number of segments that are evaluated as candidates for consolidation

                              • A value in the range [0.0, 1.0]

                              • The segment candidates for the “consolidation” operation are selected based upon several possible configurable formulas as defined by their types. The currently supported types are:

                                • "tier": consolidate based on segment byte size and live document count as dictated by the customization attributes.
                                • "bytes_accum": consolidate if and only if {threshold} > (segment_bytes + sum_of_merge_candidate_segment_bytes) / all_segment_bytes i.e. the sum of all candidate segment byte size is less than the total segment byte size multiplied by the {threshold}.

                                Possible values: "tier", "bytes_accum"

                            • A unique identifier of the View. This is an internal property.

                            • A unique identifier of the View (deprecated).

                            • The name of the View.

                            • An array of strings defining sort expressions that can be optimized. This is also known as WAND optimization (Enterprise Edition only, introduced in v3.12.0).

                            • Whether the primary key columns are always cached in memory (Enterprise Edition only).

                            • The primary sort order, described by an array of objects, each specifying a field (attribute path) and a sort direction.

                              • The sort direction.

                                • true for ascending
                                • false for descending

                              • An attribute path. The . character denotes sub-attributes.

                            • Whether the primary sort columns are always cached in memory (Enterprise Edition only).

                            • Defines how the primary sort data is compressed.

                              • "lz4": LZ4 fast compression
                              • "none": no compression

                              Possible values: "lz4", "none"

                            • An array of objects that describes which document attributes are stored in the View index for covering search queries, which means the data can be taken from the index directly and accessing the storage engine can be avoided.

                              • Whether stored values are always cached in memory (Enterprise Edition only).

                              • The compression type used for the internal column-store.

                                • "lz4": LZ4 fast compression
                                • "none": no compression

                                Possible values: "lz4", "none"

                              • An array of strings with one or more document attribute paths.

                            • The type of the View ("arangosearch").

                            • Maximum number of concurrent active writers (segments) that perform a transaction. Other writers (segments) wait till current active writers (segments) finish (0 = disabled).

                            • Maximum number of writers (segments) cached in the pool (0 = disabled).

                            • Maximum memory byte size per writer (segment) before a writer (segment) flush is triggered. 0 value turns off this limit for any writer (buffer) and data is flushed periodically based on the value defined for the flush thread (0 = disabled).

                          • The view-name path parameter is missing or invalid.

                              Response Body application/json object
                            • The HTTP response status code.

                            • A flag indicating that an error occurred.

                            • A descriptive error message.

                            • ArangoDB error number for the error that occurred.

                          • A View called view-name could not be found.

                              Response Body application/json object
                            • The HTTP response status code.

                            • A flag indicating that an error occurred.

                            • A descriptive error message.

                            • ArangoDB error number for the error that occurred.

                          Examples

                          curl -X PATCH --header 'accept: application/json' --data-binary @- --dump - 'http://localhost:8529/_api/view/productsView/properties' <<'EOF'
                          {
                            "locale": "en"
                          }
                          EOF
                          Show output

                          Rename a View

                          PUT /_db/{database-name}/_api/view/{view-name}/rename

                          Renames a View.

                          Renaming Views is not supported in cluster deployments.
                          Path Parameters
                          • The name of the database.

                          • The name of the View to rename.

                          Query Parameters
                            HTTP Headers
                              Request Body application/json object
                              • The new name for the View.

                              Responses
                              • The View has been renamed successfully.

                                  Response Body application/json object
                                • Wait at least this many commits between removing unused files in the ArangoSearch data directory (0 = disabled).

                                • Wait at least this many milliseconds between committing View data store changes and making documents visible to queries (0 = disabled).

                                • Wait at least this many milliseconds between applying consolidationPolicy to consolidate the View data store and possibly release space on the filesystem (0 = disabled).

                                • The consolidation policy to apply for selecting which segments should be merged.

                                  • If the tier type is used, then the segments* and minScore properties are available.
                                  • If the bytes_accum type is used, then the threshold property is available.

                                  • Filter out consolidation candidates with a score less than this.

                                  • Defines the value (in bytes) to treat all smaller segments as equal for consolidation selection.

                                  • Maximum allowed size of all consolidated segments in bytes.

                                  • The maximum number of segments that are evaluated as candidates for consolidation.

                                  • The minimum number of segments that are evaluated as candidates for consolidation

                                  • A value in the range [0.0, 1.0]

                                  • The segment candidates for the “consolidation” operation are selected based upon several possible configurable formulas as defined by their types. The currently supported types are:

                                    • "tier": consolidate based on segment byte size and live document count as dictated by the customization attributes.
                                    • "bytes_accum": consolidate if and only if {threshold} > (segment_bytes + sum_of_merge_candidate_segment_bytes) / all_segment_bytes i.e. the sum of all candidate segment byte size is less than the total segment byte size multiplied by the {threshold}.

                                    Possible values: "tier", "bytes_accum"

                                • A unique identifier of the View. This is an internal property.

                                • A unique identifier of the View (deprecated).

                                • The name of the View.

                                • An array of strings defining sort expressions that can be optimized. This is also known as WAND optimization (Enterprise Edition only, introduced in v3.12.0).

                                • Whether the primary key columns are always cached in memory (Enterprise Edition only).

                                • The primary sort order, described by an array of objects, each specifying a field (attribute path) and a sort direction.

                                  • The sort direction.

                                    • true for ascending
                                    • false for descending

                                  • An attribute path. The . character denotes sub-attributes.

                                • Whether the primary sort columns are always cached in memory (Enterprise Edition only).

                                • Defines how the primary sort data is compressed.

                                  • "lz4": LZ4 fast compression
                                  • "none": no compression

                                  Possible values: "lz4", "none"

                                • An array of objects that describes which document attributes are stored in the View index for covering search queries, which means the data can be taken from the index directly and accessing the storage engine can be avoided.

                                  • Whether stored values are always cached in memory (Enterprise Edition only).

                                  • The compression type used for the internal column-store.

                                    • "lz4": LZ4 fast compression
                                    • "none": no compression

                                    Possible values: "lz4", "none"

                                  • An array of strings with one or more document attribute paths.

                                • The type of the View ("arangosearch").

                                • Maximum number of concurrent active writers (segments) that perform a transaction. Other writers (segments) wait till current active writers (segments) finish (0 = disabled).

                                • Maximum number of writers (segments) cached in the pool (0 = disabled).

                                • Maximum memory byte size per writer (segment) before a writer (segment) flush is triggered. 0 value turns off this limit for any writer (buffer) and data is flushed periodically based on the value defined for the flush thread (0 = disabled).

                              • The view-name path parameter is missing or invalid.

                                  Response Body application/json object
                                • The HTTP response status code.

                                • A flag indicating that an error occurred.

                                • A descriptive error message.

                                • ArangoDB error number for the error that occurred.

                              • A View called view-name could not be found.

                                  Response Body application/json object
                                • The HTTP response status code.

                                • A flag indicating that an error occurred.

                                • A descriptive error message.

                                • ArangoDB error number for the error that occurred.

                              Examples

                              curl -X PUT --header 'accept: application/json' --data-binary @- --dump - 'http://localhost:8529/_api/view/productsView/rename' <<'EOF'
                              {
                                "name": "catalogView"
                              }
                              EOF
                              Show output

                              Drop a View

                              DELETE /_db/{database-name}/_api/view/{view-name}
                              Deletes the View identified by view-name.
                              Path Parameters
                              • The name of the database.

                              • The name of the View to drop.

                              Query Parameters
                                HTTP Headers
                                  Responses
                                  • The View has been dropped successfully.

                                      Response Body application/json object
                                    • The HTTP response status code.

                                    • A flag indicating that no error occurred.

                                    • The value true.

                                  • The view-name path parameter is missing or invalid.

                                      Response Body application/json object
                                    • The HTTP response status code.

                                    • A flag indicating that an error occurred.

                                    • A descriptive error message.

                                    • ArangoDB error number for the error that occurred.

                                  • A View called view-name could not be found.

                                      Response Body application/json object
                                    • The HTTP response status code.

                                    • A flag indicating that an error occurred.

                                    • A descriptive error message.

                                    • ArangoDB error number for the error that occurred.

                                  Examples

                                  Using an identifier:

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

                                  Using a name:

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