ArangoDB v4.x is under development and not released yet.
This documentation is not final and potentially incomplete.
arangosearch View HTTP API
The HTTP API for Views lets you manage arangosearch Views, including handling the general View properties and View links
Create an arangosearch View
cleanupIntervalStep integer (default:
2)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.Also see ArangoSearch cleanup.
commitIntervalMsec integer (default:
1000)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.Also see ArangoSearch commits.
consolidationIntervalMsec integer (default:
5000)Wait at least this many milliseconds between applying
consolidationPolicyto 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.Also see ArangoSearch consolidation.
consolidationPolicy object
The consolidation policy to apply for selecting which segments should be merged.
- If the
tiertype is used, then themaxSkewThresholdandminDeletionRatioproperties are available. - If the
bytes_accumtype is used, then thethresholdproperty is available.
Also see ArangoSearch consolidation.
maxSkewThreshold number (default:
0.4)Introduced in: v3.12.7
The skew describes how much segment files vary in file size. It is a number between
0.0and1.0and is calculated by dividing the largest file size of a set of segment files by the total size. For example, the skew of a 200 MiB, 300 MiB, and 500 MiB segment file is0.5(500 / 1000).A large
maxSkewThresholdvalue allows merging large segment files with smaller ones, consolidation occurs more frequently, and there are fewer segment files on disk at all times. While this may potentially improve the read performance and use fewer file descriptors, frequent consolidations cause a higher write load and thus a higher write amplification.On the other hand, a small threshold value triggers the consolidation only when there are a large number of segment files that don’t vary in size a lot. Consolidation occurs less frequently, reducing the write amplification, but it can result in a greater number of segment files on disk.
Multiple combinations of candidate segments are checked and the one with the lowest skew value is selected for consolidation. The selection process picks the greatest number of segments that together have the lowest skew value while ensuring that the size of the new consolidated segment remains under the configured
segmentsBytesMax.minDeletionRatio number (default:
0.5)Introduced in: v3.12.7
The
minDeletionRatiorepresents the minimum required deletion ratio in one or more segments to perform a cleanup of those segments. It is a number between0.0and1.0.The deletion ratio is the percentage of deleted documents across one or more segment files and is calculated by dividing the number of deleted documents by the total number of documents in a segment or a group of segments. For example, if there is a segment with 1000 documents of which 300 are deleted and another segment with 1000 documents of which 700 are deleted, the deletion ratio is
0.5(50%, calculated as1000 / 2000).The
minDeletionRatiothreshold must be carefully selected. A smaller value leads to earlier cleanup of deleted documents from segments and thus reclamation of disk space but it generates a higher write load. A very large value lowers the write amplification but at the same time the system can be left with a large number of segment files with a high percentage of deleted documents that occupy disk space unnecessarily.During cleanup, the segment files are first arranged in decreasing order of their individual deletion ratios. Then the largest subset of segments whose collective deletion ratio is greater than or equal to
minDeletionRatiois picked.type string (default:
"tier"), requiredPossible values:
"tier","bytes_accum"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 skew 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_bytesi.e. the sum of all candidate segment byte size is less than the total segment byte size multiplied by the{threshold}.
- If the
links object
Expects an object with the attribute keys being names of to be linked collections, and the link properties as attribute values. Example:
{ "name": "arangosearch", "links": { "coll": { "fields": { "my_attribute": { "fields": { "my_sub_attribute": { "analyzers": ["text_en"] } } } } } } }See
arangosearchView Link Properties for details.optimizeTopK array of strings (default:
[])Introduced in: v3.12.0
An array of strings defining sort expressions that you want to optimize. This is also known as WAND optimization.
This option is immutable.
If you query a View with the
SEARCHoperation in combination with aSORTandLIMIToperation, search results can be retrieved faster if theSORTexpression 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@docin the expression where you would normally pass the document variable emitted by theSEARCHoperation to the scoring function.You can define up to 64 expressions per View.
Example:
["BM25(@doc) DESC", "TFIDF(@doc, true) DESC"]primaryKeyCache boolean
Introduced in: v3.9.6, v3.10.2
If you enable this option, then the primary key columns are always cached in memory. 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-limitstartup 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-leaderstartup option (introduced in v3.10.6).primarySort array of objects (default:
[])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
primarySortdefinition, then theSORToperation 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"}, … ]primarySortCache boolean
Introduced in: v3.9.6, v3.10.2
If you enable this option, then the primary sort columns are always cached in memory. 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-limitstartup 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-leaderstartup option (introduced in v3.10.6).storedValues array of objects (default:
[])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
storedValuesoption is not to be confused with thestoreValuesoption, which allows you to store meta data about attribute values in the View index.cache boolean (default:
false)Introduced in: v3.9.5, v3.10.2
Whether to always cache stored values in memory. 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-limitstartup 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-leaderstartup option (introduced in v3.10.6).fields array of strings, required
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.
writebufferSizeMax integer (default:
33554432)Maximum memory byte size per writer (segment) before a writer (segment) flush is triggered. The value
0turns 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).
201 Created
The View has been created.
consolidationPolicy object
The consolidation policy to apply for selecting which segments should be merged.
- If the
tiertype is used, then themaxSkewThresholdandminDeletionRatioproperties are available. - If the
bytes_accumtype is used, then thethresholdproperty is available.
maxSkewThreshold number, optional
Introduced in: v3.12.7
The skew describes how much segment files vary in file size. It is a number between
0.0and1.0and is calculated by dividing the largest file size of a set of segment files by the total size. For example, the skew of a 200 MiB, 300 MiB, and 500 MiB segment file is0.5(500 / 1000).A large
maxSkewThresholdvalue allows merging large segment files with smaller ones, consolidation occurs more frequently, and there are fewer segment files on disk at all times. While this may potentially improve the read performance and use fewer file descriptors, frequent consolidations cause a higher write load and thus a higher write amplification.On the other hand, a small threshold value triggers the consolidation only when there are a large number of segment files that don’t vary in size a lot. Consolidation occurs less frequently, reducing the write amplification, but it can result in a greater number of segment files on disk.
Multiple combinations of candidate segments are checked and the one with the lowest skew value is selected for consolidation. The selection process picks the greatest number of segments that together have the lowest skew value while ensuring that the size of the new consolidated segment remains under the configured
segmentsBytesMax.minDeletionRatio number, optional
Introduced in: v3.12.7
The
minDeletionRatiorepresents the minimum required deletion ratio in one or more segments to perform a cleanup of those segments. It is a number between0.0and1.0.The deletion ratio is the percentage of deleted documents across one or more segment files and is calculated by dividing the number of deleted documents by the total number of documents in a segment or a group of segments. For example, if there is a segment with 1000 documents of which 300 are deleted and another segment with 1000 documents of which 700 are deleted, the deletion ratio is
0.5(50%, calculated as1000 / 2000).The
minDeletionRatiothreshold must be carefully selected. A smaller value leads to earlier cleanup of deleted documents from segments and thus reclamation of disk space but it generates a higher write load. A very large value lowers the write amplification but at the same time the system can be left with a large number of segment files with a high percentage of deleted documents that occupy disk space unnecessarily.During cleanup, the segment files are first arranged in decreasing order of their individual deletion ratios. Then the largest subset of segments whose collective deletion ratio is greater than or equal to
minDeletionRatiois picked.type string, optional
Possible values:
"tier","bytes_accum"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 skew 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_bytesi.e. the sum of all candidate segment byte size is less than the total segment byte size multiplied by the{threshold}.
- If the
links object
An object with the attribute keys being names of to be linked collections, and the link properties as attribute values. See
arangosearchView Link Properties for details.
Response Body application/json object
Examples
curl -X POST --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/view
{
"name": "products",
"type": "arangosearch"
}Show output
HTTP/1.1 201 Created
content-type: application/json
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0
connection: Keep-Alive
content-length: 489
content-security-policy: frame-ancestors 'self'; form-action 'self';
expires: 0
pragma: no-cache
server: ArangoDB
strict-transport-security: max-age=31536000 ; includeSubDomains
x-arango-queue-time-seconds: 0.000000
x-content-type-options: nosniff
{
"globallyUniqueId" : "h7F0F0D5E4468/70945",
"id" : "70945",
"name" : "products",
"type" : "arangosearch",
"cleanupIntervalStep" : 2,
"commitIntervalMsec" : 1000,
"consolidationIntervalMsec" : 1000,
"consolidationPolicy" : {
"type" : "tier",
"segmentsBytesFloor" : 2097152,
"segmentsBytesMax" : 5368709120,
"segmentsMax" : 10,
"segmentsMin" : 1,
"minScore" : 0
},
"optimizeTopK" : [ ],
"primarySort" : [ ],
"primarySortCompression" : "lz4",
"storedValues" : [ ],
"writebufferActive" : 0,
"writebufferIdle" : 64,
"writebufferSizeMax" : 33554432,
"links" : {
}
}Get information about a View
Examples
Using an identifier:
curl --header 'accept: application/json' --dump - http://localhost:8529/_api/view/71063Show output
HTTP/1.1 200 OK
content-type: application/json
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0
connection: Keep-Alive
content-length: 124
content-security-policy: frame-ancestors 'self'; form-action 'self';
expires: 0
pragma: no-cache
server: ArangoDB
strict-transport-security: max-age=31536000 ; includeSubDomains
x-arango-queue-time-seconds: 0.000000
x-content-type-options: nosniff
{
"error" : false,
"code" : 200,
"type" : "arangosearch",
"name" : "productsView",
"id" : "71063",
"globallyUniqueId" : "h7F0F0D5E4468/71063"
}Using a name:
curl --header 'accept: application/json' --dump - http://localhost:8529/_api/view/productsViewShow output
HTTP/1.1 200 OK
content-type: application/json
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0
connection: Keep-Alive
content-length: 124
content-security-policy: frame-ancestors 'self'; form-action 'self';
expires: 0
pragma: no-cache
server: ArangoDB
strict-transport-security: max-age=31536000 ; includeSubDomains
x-arango-queue-time-seconds: 0.000000
x-content-type-options: nosniff
{
"error" : false,
"code" : 200,
"type" : "arangosearch",
"name" : "productsView",
"id" : "71203",
"globallyUniqueId" : "h7F0F0D5E4468/71203"
}Get the properties of a View
view-name.200 OK
An object with a full description of the specified View, including
arangosearchView type-dependent properties.consolidationPolicy object
The consolidation policy to apply for selecting which segments should be merged.
- If the
tiertype is used, then themaxSkewThresholdandminDeletionRatioproperties are available. - If the
bytes_accumtype is used, then thethresholdproperty is available.
maxSkewThreshold number, optional
Introduced in: v3.12.7
The skew describes how much segment files vary in file size. It is a number between
0.0and1.0and is calculated by dividing the largest file size of a set of segment files by the total size. For example, the skew of a 200 MiB, 300 MiB, and 500 MiB segment file is0.5(500 / 1000).A large
maxSkewThresholdvalue allows merging large segment files with smaller ones, consolidation occurs more frequently, and there are fewer segment files on disk at all times. While this may potentially improve the read performance and use fewer file descriptors, frequent consolidations cause a higher write load and thus a higher write amplification.On the other hand, a small threshold value triggers the consolidation only when there are a large number of segment files that don’t vary in size a lot. Consolidation occurs less frequently, reducing the write amplification, but it can result in a greater number of segment files on disk.
Multiple combinations of candidate segments are checked and the one with the lowest skew value is selected for consolidation. The selection process picks the greatest number of segments that together have the lowest skew value while ensuring that the size of the new consolidated segment remains under the configured
segmentsBytesMax.minDeletionRatio number, optional
Introduced in: v3.12.7
The
minDeletionRatiorepresents the minimum required deletion ratio in one or more segments to perform a cleanup of those segments. It is a number between0.0and1.0.The deletion ratio is the percentage of deleted documents across one or more segment files and is calculated by dividing the number of deleted documents by the total number of documents in a segment or a group of segments. For example, if there is a segment with 1000 documents of which 300 are deleted and another segment with 1000 documents of which 700 are deleted, the deletion ratio is
0.5(50%, calculated as1000 / 2000).The
minDeletionRatiothreshold must be carefully selected. A smaller value leads to earlier cleanup of deleted documents from segments and thus reclamation of disk space but it generates a higher write load. A very large value lowers the write amplification but at the same time the system can be left with a large number of segment files with a high percentage of deleted documents that occupy disk space unnecessarily.During cleanup, the segment files are first arranged in decreasing order of their individual deletion ratios. Then the largest subset of segments whose collective deletion ratio is greater than or equal to
minDeletionRatiois picked.type string, optional
Possible values:
"tier","bytes_accum"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 skew 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_bytesi.e. the sum of all candidate segment byte size is less than the total segment byte size multiplied by the{threshold}.
- If the
links object
An object with the attribute keys being names of to be linked collections, and the link properties as attribute values. See
arangosearchView Link Properties for details.
Response Body application/json object
Examples
Using an identifier:
curl --header 'accept: application/json' --dump - http://localhost:8529/_api/view/71321/propertiesShow output
HTTP/1.1 200 OK
content-type: application/json
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0
connection: Keep-Alive
content-length: 670
content-security-policy: frame-ancestors 'self'; form-action 'self';
expires: 0
pragma: no-cache
server: ArangoDB
strict-transport-security: max-age=31536000 ; includeSubDomains
x-arango-queue-time-seconds: 0.000000
x-content-type-options: nosniff
{
"error" : false,
"code" : 200,
"writebufferSizeMax" : 33554432,
"writebufferIdle" : 64,
"id" : "71321",
"storedValues" : [ ],
"name" : "productsView",
"type" : "arangosearch",
"consolidationPolicy" : {
"type" : "tier",
"segmentsBytesFloor" : 2097152,
"segmentsBytesMax" : 5368709120,
"segmentsMax" : 10,
"segmentsMin" : 1,
"minScore" : 0
},
"writebufferActive" : 0,
"links" : {
"books" : {
"analyzers" : [
"identity"
],
"fields" : {
"title" : {
"analyzers" : [
"text_en"
]
}
},
"includeAllFields" : false,
"storeValues" : "none",
"trackListPositions" : false
}
},
"commitIntervalMsec" : 1000,
"consolidationIntervalMsec" : 1000,
"optimizeTopK" : [ ],
"globallyUniqueId" : "h7F0F0D5E4468/71321",
"cleanupIntervalStep" : 2,
"primarySort" : [ ],
"primarySortCompression" : "lz4"
}Using a name:
curl --header 'accept: application/json' --dump - http://localhost:8529/_api/view/productsView/propertiesShow output
HTTP/1.1 200 OK
content-type: application/json
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0
connection: Keep-Alive
content-length: 670
content-security-policy: frame-ancestors 'self'; form-action 'self';
expires: 0
pragma: no-cache
server: ArangoDB
strict-transport-security: max-age=31536000 ; includeSubDomains
x-arango-queue-time-seconds: 0.000000
x-content-type-options: nosniff
{
"error" : false,
"code" : 200,
"writebufferSizeMax" : 33554432,
"writebufferIdle" : 64,
"id" : "71433",
"storedValues" : [ ],
"name" : "productsView",
"type" : "arangosearch",
"consolidationPolicy" : {
"type" : "tier",
"segmentsBytesFloor" : 2097152,
"segmentsBytesMax" : 5368709120,
"segmentsMax" : 10,
"segmentsMin" : 1,
"minScore" : 0
},
"writebufferActive" : 0,
"links" : {
"books" : {
"analyzers" : [
"identity"
],
"fields" : {
"title" : {
"analyzers" : [
"text_en"
]
}
},
"includeAllFields" : false,
"storeValues" : "none",
"trackListPositions" : false
}
},
"commitIntervalMsec" : 1000,
"consolidationIntervalMsec" : 1000,
"optimizeTopK" : [ ],
"globallyUniqueId" : "h7F0F0D5E4468/71433",
"cleanupIntervalStep" : 2,
"primarySort" : [ ],
"primarySortCompression" : "lz4"
}List all Views
Examples
Return information about all Views:
curl --header 'accept: application/json' --dump - http://localhost:8529/_api/viewShow output
HTTP/1.1 200 OK
content-type: application/json
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0
connection: Keep-Alive
content-length: 328
content-security-policy: frame-ancestors 'self'; form-action 'self';
expires: 0
pragma: no-cache
server: ArangoDB
strict-transport-security: max-age=31536000 ; includeSubDomains
x-arango-queue-time-seconds: 0.000000
x-content-type-options: nosniff
{
"error" : false,
"code" : 200,
"result" : [
{
"globallyUniqueId" : "h7F0F0D5E4468/181",
"id" : "181",
"name" : "demoView",
"type" : "arangosearch"
},
{
"globallyUniqueId" : "h7F0F0D5E4468/71572",
"id" : "71572",
"name" : "productsView",
"type" : "search-alias"
},
{
"globallyUniqueId" : "h7F0F0D5E4468/71573",
"id" : "71573",
"name" : "reviewsView",
"type" : "arangosearch"
}
]
}Replace the properties of an arangosearch View
cleanupIntervalStep integer (default:
2)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.Also see ArangoSearch cleanup.
commitIntervalMsec integer (default:
1000)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.Also see ArangoSearch commits.
consolidationIntervalMsec integer (default:
5000)Wait at least this many milliseconds between applying
consolidationPolicyto 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.Also see ArangoSearch consolidation.
consolidationPolicy object
The consolidation policy to apply for selecting which segments should be merged.
- If the
tiertype is used, then themaxSkewThresholdandminDeletionRatioproperties are available. - If the
bytes_accumtype is used, then thethresholdproperty is available.
Also see ArangoSearch consolidation.
maxSkewThreshold number (default:
0.4)Introduced in: v3.12.7
The skew describes how much segment files vary in file size. It is a number between
0.0and1.0and is calculated by dividing the largest file size of a set of segment files by the total size. For example, the skew of a 200 MiB, 300 MiB, and 500 MiB segment file is0.5(500 / 1000).A large
maxSkewThresholdvalue allows merging large segment files with smaller ones, consolidation occurs more frequently, and there are fewer segment files on disk at all times. While this may potentially improve the read performance and use fewer file descriptors, frequent consolidations cause a higher write load and thus a higher write amplification.On the other hand, a small threshold value triggers the consolidation only when there are a large number of segment files that don’t vary in size a lot. Consolidation occurs less frequently, reducing the write amplification, but it can result in a greater number of segment files on disk.
Multiple combinations of candidate segments are checked and the one with the lowest skew value is selected for consolidation. The selection process picks the greatest number of segments that together have the lowest skew value while ensuring that the size of the new consolidated segment remains under the configured
segmentsBytesMax.minDeletionRatio number (default:
0.5)Introduced in: v3.12.7
The
minDeletionRatiorepresents the minimum required deletion ratio in one or more segments to perform a cleanup of those segments. It is a number between0.0and1.0.The deletion ratio is the percentage of deleted documents across one or more segment files and is calculated by dividing the number of deleted documents by the total number of documents in a segment or a group of segments. For example, if there is a segment with 1000 documents of which 300 are deleted and another segment with 1000 documents of which 700 are deleted, the deletion ratio is
0.5(50%, calculated as1000 / 2000).The
minDeletionRatiothreshold must be carefully selected. A smaller value leads to earlier cleanup of deleted documents from segments and thus reclamation of disk space but it generates a higher write load. A very large value lowers the write amplification but at the same time the system can be left with a large number of segment files with a high percentage of deleted documents that occupy disk space unnecessarily.During cleanup, the segment files are first arranged in decreasing order of their individual deletion ratios. Then the largest subset of segments whose collective deletion ratio is greater than or equal to
minDeletionRatiois picked.type string (default:
"tier"), requiredPossible values:
"tier","bytes_accum"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 skew 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_bytesi.e. the sum of all candidate segment byte size is less than the total segment byte size multiplied by the{threshold}.
- If the
links object
Expects an object with the attribute keys being names of to be linked collections, and the link properties as attribute values. Example:
{ "name": "arangosearch", "links": { "coll": { "fields": { "my_attribute": { "fields": { "my_sub_attribute": { "analyzers": ["text_en"] } } } } } } }See
arangosearchView Link Properties for details.
200 OK
The View has been updated successfully.
consolidationPolicy object
The consolidation policy to apply for selecting which segments should be merged.
- If the
tiertype is used, then themaxSkewThresholdandminDeletionRatioproperties are available. - If the
bytes_accumtype is used, then thethresholdproperty is available.
maxSkewThreshold number, optional
Introduced in: v3.12.7
The skew describes how much segment files vary in file size. It is a number between
0.0and1.0and is calculated by dividing the largest file size of a set of segment files by the total size. For example, the skew of a 200 MiB, 300 MiB, and 500 MiB segment file is0.5(500 / 1000).A large
maxSkewThresholdvalue allows merging large segment files with smaller ones, consolidation occurs more frequently, and there are fewer segment files on disk at all times. While this may potentially improve the read performance and use fewer file descriptors, frequent consolidations cause a higher write load and thus a higher write amplification.On the other hand, a small threshold value triggers the consolidation only when there are a large number of segment files that don’t vary in size a lot. Consolidation occurs less frequently, reducing the write amplification, but it can result in a greater number of segment files on disk.
Multiple combinations of candidate segments are checked and the one with the lowest skew value is selected for consolidation. The selection process picks the greatest number of segments that together have the lowest skew value while ensuring that the size of the new consolidated segment remains under the configured
segmentsBytesMax.minDeletionRatio number, optional
Introduced in: v3.12.7
The
minDeletionRatiorepresents the minimum required deletion ratio in one or more segments to perform a cleanup of those segments. It is a number between0.0and1.0.The deletion ratio is the percentage of deleted documents across one or more segment files and is calculated by dividing the number of deleted documents by the total number of documents in a segment or a group of segments. For example, if there is a segment with 1000 documents of which 300 are deleted and another segment with 1000 documents of which 700 are deleted, the deletion ratio is
0.5(50%, calculated as1000 / 2000).The
minDeletionRatiothreshold must be carefully selected. A smaller value leads to earlier cleanup of deleted documents from segments and thus reclamation of disk space but it generates a higher write load. A very large value lowers the write amplification but at the same time the system can be left with a large number of segment files with a high percentage of deleted documents that occupy disk space unnecessarily.During cleanup, the segment files are first arranged in decreasing order of their individual deletion ratios. Then the largest subset of segments whose collective deletion ratio is greater than or equal to
minDeletionRatiois picked.type string, optional
Possible values:
"tier","bytes_accum"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 skew 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_bytesi.e. the sum of all candidate segment byte size is less than the total segment byte size multiplied by the{threshold}.
- If the
links object
An object with the attribute keys being names of to be linked collections, and the link properties as attribute values. See
arangosearchView Link Properties for details.
Response Body application/json object
Examples
Replace the properties of an arangosearch View including any links with new
properties. All mutable properties that are not specified are reset to their
default values.
curl -X PUT --header 'accept: application/json' --data-binary @- --dump - 'http://localhost:8529/_api/view/productsView/properties' <<'EOF'
{
"cleanupIntervalStep": 12,
"links": {
"products": {
"fields": {
"description": {
"analyzers": [
"text_en"
]
}
}
}
}
}
EOFShow output
HTTP/1.1 200 OK
content-type: application/json
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0
connection: Keep-Alive
content-length: 655
content-security-policy: frame-ancestors 'self'; form-action 'self';
expires: 0
pragma: no-cache
server: ArangoDB
strict-transport-security: max-age=31536000 ; includeSubDomains
x-arango-queue-time-seconds: 0.000000
x-content-type-options: nosniff
{
"globallyUniqueId" : "h4F83C58DC4C5/71959",
"id" : "71959",
"name" : "productsView",
"type" : "arangosearch",
"cleanupIntervalStep" : 12,
"commitIntervalMsec" : 1000,
"consolidationIntervalMsec" : 1000,
"consolidationPolicy" : {
"type" : "tier",
"segmentsBytesFloor" : 2097152,
"segmentsBytesMax" : 5368709120,
"segmentsMax" : 10,
"segmentsMin" : 1,
"minScore" : 0
},
"optimizeTopK" : [ ],
"primarySort" : [ ],
"primarySortCompression" : "lz4",
"storedValues" : [ ],
"writebufferActive" : 0,
"writebufferIdle" : 64,
"writebufferSizeMax" : 33554432,
"links" : {
"products" : {
"analyzers" : [
"identity"
],
"fields" : {
"description" : {
"analyzers" : [
"text_en"
]
}
},
"includeAllFields" : false,
"storeValues" : "none",
"trackListPositions" : false
}
}
}Update the properties of an arangosearch View
cleanupIntervalStep integer
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.Also see ArangoSearch cleanup.
commitIntervalMsec integer
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.Also see ArangoSearch commits.
consolidationIntervalMsec integer
Wait at least this many milliseconds between applying
consolidationPolicyto 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.Also see ArangoSearch consolidation.
consolidationPolicy object
The consolidation policy to apply for selecting which segments should be merged.
- If the
tiertype is used, then themaxSkewThresholdandminDeletionRatioproperties are available. - If the
bytes_accumtype is used, then thethresholdproperty is available.
Also see ArangoSearch consolidation.
maxSkewThreshold number (default:
0.4)Introduced in: v3.12.7
The skew describes how much segment files vary in file size. It is a number between
0.0and1.0and is calculated by dividing the largest file size of a set of segment files by the total size. For example, the skew of a 200 MiB, 300 MiB, and 500 MiB segment file is0.5(500 / 1000).A large
maxSkewThresholdvalue allows merging large segment files with smaller ones, consolidation occurs more frequently, and there are fewer segment files on disk at all times. While this may potentially improve the read performance and use fewer file descriptors, frequent consolidations cause a higher write load and thus a higher write amplification.On the other hand, a small threshold value triggers the consolidation only when there are a large number of segment files that don’t vary in size a lot. Consolidation occurs less frequently, reducing the write amplification, but it can result in a greater number of segment files on disk.
Multiple combinations of candidate segments are checked and the one with the lowest skew value is selected for consolidation. The selection process picks the greatest number of segments that together have the lowest skew value while ensuring that the size of the new consolidated segment remains under the configured
segmentsBytesMax.minDeletionRatio number (default:
0.5)Introduced in: v3.12.7
The
minDeletionRatiorepresents the minimum required deletion ratio in one or more segments to perform a cleanup of those segments. It is a number between0.0and1.0.The deletion ratio is the percentage of deleted documents across one or more segment files and is calculated by dividing the number of deleted documents by the total number of documents in a segment or a group of segments. For example, if there is a segment with 1000 documents of which 300 are deleted and another segment with 1000 documents of which 700 are deleted, the deletion ratio is
0.5(50%, calculated as1000 / 2000).The
minDeletionRatiothreshold must be carefully selected. A smaller value leads to earlier cleanup of deleted documents from segments and thus reclamation of disk space but it generates a higher write load. A very large value lowers the write amplification but at the same time the system can be left with a large number of segment files with a high percentage of deleted documents that occupy disk space unnecessarily.During cleanup, the segment files are first arranged in decreasing order of their individual deletion ratios. Then the largest subset of segments whose collective deletion ratio is greater than or equal to
minDeletionRatiois picked.type string, required
Possible values:
"tier","bytes_accum"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 skew 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_bytesi.e. the sum of all candidate segment byte size is less than the total segment byte size multiplied by the{threshold}.
- If the
links object
Expects an object with the attribute keys being names of to be linked collections, and the link properties as attribute values. Example:
{ "name": "arangosearch", "links": { "coll": { "fields": { "my_attribute": { "fields": { "my_sub_attribute": { "analyzers": ["text_en"] } } } } } } }See
arangosearchView Link Properties for details.
200 OK
The View has been updated successfully.
consolidationPolicy object
The consolidation policy to apply for selecting which segments should be merged.
- If the
tiertype is used, then themaxSkewThresholdandminDeletionRatioproperties are available. - If the
bytes_accumtype is used, then thethresholdproperty is available.
maxSkewThreshold number, optional
Introduced in: v3.12.7
The skew describes how much segment files vary in file size. It is a number between
0.0and1.0and is calculated by dividing the largest file size of a set of segment files by the total size. For example, the skew of a 200 MiB, 300 MiB, and 500 MiB segment file is0.5(500 / 1000).A large
maxSkewThresholdvalue allows merging large segment files with smaller ones, consolidation occurs more frequently, and there are fewer segment files on disk at all times. While this may potentially improve the read performance and use fewer file descriptors, frequent consolidations cause a higher write load and thus a higher write amplification.On the other hand, a small threshold value triggers the consolidation only when there are a large number of segment files that don’t vary in size a lot. Consolidation occurs less frequently, reducing the write amplification, but it can result in a greater number of segment files on disk.
Multiple combinations of candidate segments are checked and the one with the lowest skew value is selected for consolidation. The selection process picks the greatest number of segments that together have the lowest skew value while ensuring that the size of the new consolidated segment remains under the configured
segmentsBytesMax.minDeletionRatio number, optional
Introduced in: v3.12.7
The
minDeletionRatiorepresents the minimum required deletion ratio in one or more segments to perform a cleanup of those segments. It is a number between0.0and1.0.The deletion ratio is the percentage of deleted documents across one or more segment files and is calculated by dividing the number of deleted documents by the total number of documents in a segment or a group of segments. For example, if there is a segment with 1000 documents of which 300 are deleted and another segment with 1000 documents of which 700 are deleted, the deletion ratio is
0.5(50%, calculated as1000 / 2000).The
minDeletionRatiothreshold must be carefully selected. A smaller value leads to earlier cleanup of deleted documents from segments and thus reclamation of disk space but it generates a higher write load. A very large value lowers the write amplification but at the same time the system can be left with a large number of segment files with a high percentage of deleted documents that occupy disk space unnecessarily.During cleanup, the segment files are first arranged in decreasing order of their individual deletion ratios. Then the largest subset of segments whose collective deletion ratio is greater than or equal to
minDeletionRatiois picked.type string, optional
Possible values:
"tier","bytes_accum"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 skew 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_bytesi.e. the sum of all candidate segment byte size is less than the total segment byte size multiplied by the{threshold}.
- If the
links object
An object with the attribute keys being names of to be linked collections, and the link properties as attribute values. See
arangosearchView Link Properties for details.
Response Body application/json object
Examples
Update the properties of an arangosearch View, only changing one setting
and removing a link. All other mutable properties that are not specified
keep their current values.
curl -X PATCH --header 'accept: application/json' --data-binary @- --dump - 'http://localhost:8529/_api/view/productsView/properties' <<'EOF'
{
"cleanupIntervalStep": 12,
"links": {
"products": null
}
}
EOFShow output
HTTP/1.1 200 OK
content-type: application/json
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0
connection: Keep-Alive
content-length: 610
content-security-policy: frame-ancestors 'self'; form-action 'self';
expires: 0
pragma: no-cache
server: ArangoDB
strict-transport-security: max-age=31536000 ; includeSubDomains
x-arango-queue-time-seconds: 0.000000
x-content-type-options: nosniff
{
"globallyUniqueId" : "h4F83C58DC4C5/72087",
"id" : "72087",
"name" : "productsView",
"type" : "arangosearch",
"cleanupIntervalStep" : 12,
"commitIntervalMsec" : 666,
"consolidationIntervalMsec" : 666,
"consolidationPolicy" : {
"type" : "tier",
"segmentsBytesFloor" : 2097152,
"segmentsBytesMax" : 5368709120,
"segmentsMax" : 10,
"segmentsMin" : 1,
"minScore" : 0
},
"optimizeTopK" : [ ],
"primarySort" : [ ],
"primarySortCompression" : "lz4",
"storedValues" : [ ],
"writebufferActive" : 0,
"writebufferIdle" : 64,
"writebufferSizeMax" : 33554432,
"links" : {
"users" : {
"analyzers" : [
"identity"
],
"fields" : {
},
"includeAllFields" : true,
"storeValues" : "none",
"trackListPositions" : false
}
}
}Rename a View
Renames a View.
200 OK
The View has been renamed successfully.
consolidationPolicy object
The consolidation policy to apply for selecting which segments should be merged.
- If the
tiertype is used, then themaxSkewThresholdandminDeletionRatioproperties are available. - If the
bytes_accumtype is used, then thethresholdproperty is available.
maxSkewThreshold number, optional
Introduced in: v3.12.7
The skew describes how much segment files vary in file size. It is a number between
0.0and1.0and is calculated by dividing the largest file size of a set of segment files by the total size. For example, the skew of a 200 MiB, 300 MiB, and 500 MiB segment file is0.5(500 / 1000).A large
maxSkewThresholdvalue allows merging large segment files with smaller ones, consolidation occurs more frequently, and there are fewer segment files on disk at all times. While this may potentially improve the read performance and use fewer file descriptors, frequent consolidations cause a higher write load and thus a higher write amplification.On the other hand, a small threshold value triggers the consolidation only when there are a large number of segment files that don’t vary in size a lot. Consolidation occurs less frequently, reducing the write amplification, but it can result in a greater number of segment files on disk.
Multiple combinations of candidate segments are checked and the one with the lowest skew value is selected for consolidation. The selection process picks the greatest number of segments that together have the lowest skew value while ensuring that the size of the new consolidated segment remains under the configured
segmentsBytesMax.minDeletionRatio number, optional
Introduced in: v3.12.7
The
minDeletionRatiorepresents the minimum required deletion ratio in one or more segments to perform a cleanup of those segments. It is a number between0.0and1.0.The deletion ratio is the percentage of deleted documents across one or more segment files and is calculated by dividing the number of deleted documents by the total number of documents in a segment or a group of segments. For example, if there is a segment with 1000 documents of which 300 are deleted and another segment with 1000 documents of which 700 are deleted, the deletion ratio is
0.5(50%, calculated as1000 / 2000).The
minDeletionRatiothreshold must be carefully selected. A smaller value leads to earlier cleanup of deleted documents from segments and thus reclamation of disk space but it generates a higher write load. A very large value lowers the write amplification but at the same time the system can be left with a large number of segment files with a high percentage of deleted documents that occupy disk space unnecessarily.During cleanup, the segment files are first arranged in decreasing order of their individual deletion ratios. Then the largest subset of segments whose collective deletion ratio is greater than or equal to
minDeletionRatiois picked.type string, optional
Possible values:
"tier","bytes_accum"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 skew 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_bytesi.e. the sum of all candidate segment byte size is less than the total segment byte size multiplied by the{threshold}.
- If the
links object
An object with the attribute keys being names of to be linked collections, and the link properties as attribute values. See
arangosearchView Link Properties for details.
Response Body application/json object
Examples
curl -X PUT --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/view/productsView/rename
{
"name": "catalogView"
}Show output
HTTP/1.1 200 OK
content-type: application/json
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0
connection: Keep-Alive
content-length: 492
content-security-policy: frame-ancestors 'self'; form-action 'self';
expires: 0
pragma: no-cache
server: ArangoDB
strict-transport-security: max-age=31536000 ; includeSubDomains
x-arango-queue-time-seconds: 0.000000
x-content-type-options: nosniff
{
"globallyUniqueId" : "h7F0F0D5E4468/71887",
"id" : "71887",
"name" : "catalogView",
"type" : "arangosearch",
"cleanupIntervalStep" : 2,
"commitIntervalMsec" : 1000,
"consolidationIntervalMsec" : 1000,
"consolidationPolicy" : {
"type" : "tier",
"segmentsBytesFloor" : 2097152,
"segmentsBytesMax" : 5368709120,
"segmentsMax" : 10,
"segmentsMin" : 1,
"minScore" : 0
},
"optimizeTopK" : [ ],
"primarySort" : [ ],
"primarySortCompression" : "lz4",
"storedValues" : [ ],
"writebufferActive" : 0,
"writebufferIdle" : 64,
"writebufferSizeMax" : 33554432,
"links" : {
}
}Drop a View
view-name.Examples
Using an identifier:
curl -X DELETE --header 'accept: application/json' --dump - http://localhost:8529/_api/view/72027Show output
HTTP/1.1 200 OK
content-type: application/json
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0
connection: Keep-Alive
content-length: 40
content-security-policy: frame-ancestors 'self'; form-action 'self';
expires: 0
pragma: no-cache
server: ArangoDB
strict-transport-security: max-age=31536000 ; includeSubDomains
x-arango-queue-time-seconds: 0.000000
x-content-type-options: nosniff
{
"error" : false,
"code" : 200,
"result" : true
}Using a name:
curl -X DELETE --header 'accept: application/json' --dump - http://localhost:8529/_api/view/productsViewShow output
HTTP/1.1 200 OK
content-type: application/json
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0
connection: Keep-Alive
content-length: 40
content-security-policy: frame-ancestors 'self'; form-action 'self';
expires: 0
pragma: no-cache
server: ArangoDB
strict-transport-security: max-age=31536000 ; includeSubDomains
x-arango-queue-time-seconds: 0.000000
x-content-type-options: nosniff
{
"error" : false,
"code" : 200,
"result" : true
}