Creating and Modifying an ArangoSearch View
Create ArangoSearch view
creates an ArangoSearch view
POST /_api/view#arangosearch
A JSON object with these properties is required:
- type: The type of the view. must be equal to "arangosearch"
- name: The name of the view.
- properties:
- locale: The default locale used for queries on analyzed string values (default: C).
- commit:
- consolidate:
- count:
- threshold: Consolidate IFF {threshold} > segment_docs{valid} / (all_segment_docs{valid} / #segments) (default: 0.85)
- segmentThreshold: Apply consolidation policy IFF {segmentThreshold} >= #segments (default: 300, to disable use: 0)
- bytes:
- threshold: Consolidate IFF {threshold} > segment_bytes / (all_segment_bytes / #segments) (default: 0.85)
- segmentThreshold: Apply consolidation policy IFF {segmentThreshold} >= #segments (default: 300, to disable use: 0)
- bytes_accum:
- threshold: Consolidate IFF {threshold} > (segment_bytes + sum_of_merge_candidate_segment_bytes) / all_segment_bytes (default: 0.85)
- segmentThreshold: Apply consolidation policy IFF {segmentThreshold} >= #segments (default: 300, to disable use: 0)
- fill:
- threshold: Consolidate IFF {threshold} > #segment_docs{valid} / (#segment_docs{valid} + #segment_docs{removed}) (default: 0.85)
- segmentThreshold: Apply consolidation policy IFF {segmentThreshold} >= #segments (default: 300, to disable use: 0)
- count:
- commitIntervalMsec: Wait at least this many milliseconds between committing index data changes and making them visible to queries (default: 60000, to disable use: 0). For the case where there are a lot of inserts/updates, a lower value, until commit, will cause the index not to account for them and memory usage would continue to grow. For the case where there are a few inserts/updates, a higher value will impact performance and waste disk space for each commit call without any added benefits.
- cleanupIntervalStep: Wait at least this many commits between removing unused files in data directory (default: 10, to disable use: 0). For the case where the consolidation policies merge segments often (i.e. a lot of commit+consolidate), a lower value will cause 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 will impact performance without any added benefits.
- consolidate:
- dataPath: The filesystem path where to store persisted view data (default: "
/arangosearch- )." - threadMaxTotal: Maximum total number of threads (>0) for single-run tasks (default: 5). For the case where there are a lot of parallelizable tasks and an abundance of resources, a lower value would limit performance. For the case where there are limited resources CPU/memory, a higher value will negatively impact performance.
- threadMaxIdle: Maximum idle number of threads for single-run tasks (default: 5). For the case where there are a lot of short-lived asynchronous tasks, a lower value will cause a lot of thread creation/deletion calls. For the case where there are no short-lived asynchronous tasks, a higher value will only waste memory.
Creates a new view with a given name and properties if it does not already exist.
Note: view can't be created with the links. Please use PUT/PATCH for links management.
Return Codes
400: If the view-name is missing, then a HTTP 400 is returned.
404: If the view-name is unknown, then a HTTP 404 is returned.
Examples
shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/view <<EOF
{
"name" : "testViewBasics",
"type" : "arangosearch",
"properties" : {
}
}
EOF
HTTP/1.1 201 Created
content-type: application/json; charset=utf-8
x-content-type-options: nosniff
{
"id" : "15131",
"name" : "testViewBasics",
"type" : "arangosearch",
"properties" : {
"commit" : {
"cleanupIntervalStep" : 10,
"commitIntervalMsec" : 60000,
"commitTimeoutMsec" : 5000,
"consolidate" : {
"bytes" : {
"segmentThreshold" : 300,
"threshold" : 0.8500000238418579
},
"bytes_accum" : {
"segmentThreshold" : 300,
"threshold" : 0.8500000238418579
},
"count" : {
"segmentThreshold" : 300,
"threshold" : 0.8500000238418579
},
"fill" : {
"segmentThreshold" : 300,
"threshold" : 0.8500000238418579
}
}
},
"locale" : "C",
"collections" : [ ],
"links" : {
}
}
}
shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/view <<EOF
{
"name" : "testViewBasics",
"type" : "arangosearch",
"properties" : {
}
}
EOF
HTTP/1.1 201 Created
content-type: application/json; charset=utf-8
x-content-type-options: nosniff
Change properties of an ArangoSearch view
changes properties of an ArangoSearch view
PUT /_api/view/{view-name}/properties#ArangoSearch
Path Parameters
- view-name (required): The name of the view.
A JSON object with these properties is required:
- locale: The default locale used for queries on analyzed string values (default: C).
- commit:
- consolidate:
- count:
- threshold: Consolidate IFF {threshold} > segment_docs{valid} / (all_segment_docs{valid} / #segments) (default: 0.85)
- segmentThreshold: Apply consolidation policy IFF {segmentThreshold} >= #segments (default: 300, to disable use: 0)
- bytes:
- threshold: Consolidate IFF {threshold} > segment_bytes / (all_segment_bytes / #segments) (default: 0.85)
- segmentThreshold: Apply consolidation policy IFF {segmentThreshold} >= #segments (default: 300, to disable use: 0)
- bytes_accum:
- threshold: Consolidate IFF {threshold} > (segment_bytes + sum_of_merge_candidate_segment_bytes) / all_segment_bytes (default: 0.85)
- segmentThreshold: Apply consolidation policy IFF {segmentThreshold} >= #segments (default: 300, to disable use: 0)
- fill:
- threshold: Consolidate IFF {threshold} > #segment_docs{valid} / (#segment_docs{valid} + #segment_docs{removed}) (default: 0.85)
- segmentThreshold: Apply consolidation policy IFF {segmentThreshold} >= #segments (default: 300, to disable use: 0)
- count:
- commitIntervalMsec: Wait at least this many milliseconds between committing index data changes and making them visible to queries (default: 60000, to disable use: 0). For the case where there are a lot of inserts/updates, a lower value, until commit, will cause the index not to account for them and memory usage would continue to grow. For the case where there are a few inserts/updates, a higher value will impact performance and waste disk space for each commit call without any added benefits.
- cleanupIntervalStep: Wait at least this many commits between removing unused files in data directory (default: 10, to disable use: 0). For the case where the consolidation policies merge segments often (i.e. a lot of commit+consolidate), a lower value will cause 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 will impact performance without any added benefits.
- consolidate:
- threadMaxTotal: Maximum total number of threads (>0) for single-run tasks (default: 5). For the case where there are a lot of parallelizable tasks and an abundance of resources, a lower value would limit performance. For the case where there are limited resources CPU/memory, a higher value will negatively impact performance.
- threadMaxIdle: Maximum idle number of threads for single-run tasks (default: 5). For the case where there are a lot of short-lived asynchronous tasks, a lower value will cause a lot of thread creation/deletion calls. For the case where there are no short-lived asynchronous tasks, a higher value will only waste memory.
- links:
- [collection-name]:
- analyzers (string): The list of analyzers to be used for indexing of string values (default: ["identity"]).
- [field-name]:
- analyzers (string): The list of analyzers to be used for indexing of string values (default: ["identity"]).
- [field-name]: Specify properties for nested fields here
- includeAllFields: The flag determines whether or not to index all fields on a particular level of depth (default: false).
- trackListPositions: The flag determines whether or not values in a lists should be treated separate (default: false).
- includeAllFields: The flag determines whether or not to index all fields on a particular level of depth (default: false).
- trackListPositions: The flag determines whether or not values in a lists should be treated separate (default: false).
- [collection-name]:
Changes the properties of a view.
On success an object with the following attributes is returned:
- id: The identifier of the view.
- name: The name of the view.
- type: The view type. Valid types are:
- arangosearch: ArangoSearch view
- properties: The updated properties of the view.
Return Codes
400: If the view-name is missing, then a HTTP 400 is returned.
404: If the view-name is unknown, then a HTTP 404 is returned.
Examples
shell> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/view/products/properties <<EOF
{
"threadMaxIdle" : 10
}
EOF
HTTP/1.1 200 OK
content-type: application/json; charset=utf-8
x-content-type-options: nosniff
{
"id" : "12838",
"name" : "products",
"type" : "arangosearch"
}
shell> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/view/products/properties <<EOF
{
"threadMaxIdle" : 10
}
EOF
HTTP/1.1 200 OK
content-type: application/json; charset=utf-8
x-content-type-options: nosniff
Partially changes properties of an ArangoSearch view
partially changes properties of an ArangoSearch view
PATCH /_api/view/{view-name}/properties#ArangoSearch
Path Parameters
- view-name (required): The name of the view.
A JSON object with these properties is required:
- locale: The default locale used for queries on analyzed string values (default: C).
- commit:
- consolidate:
- count:
- threshold: Consolidate IFF {threshold} > segment_docs{valid} / (all_segment_docs{valid} / #segments) (default: 0.85)
- segmentThreshold: Apply consolidation policy IFF {segmentThreshold} >= #segments (default: 300, to disable use: 0)
- bytes:
- threshold: Consolidate IFF {threshold} > segment_bytes / (all_segment_bytes / #segments) (default: 0.85)
- segmentThreshold: Apply consolidation policy IFF {segmentThreshold} >= #segments (default: 300, to disable use: 0)
- bytes_accum:
- threshold: Consolidate IFF {threshold} > (segment_bytes + sum_of_merge_candidate_segment_bytes) / all_segment_bytes (default: 0.85)
- segmentThreshold: Apply consolidation policy IFF {segmentThreshold} >= #segments (default: 300, to disable use: 0)
- fill:
- threshold: Consolidate IFF {threshold} > #segment_docs{valid} / (#segment_docs{valid} + #segment_docs{removed}) (default: 0.85)
- segmentThreshold: Apply consolidation policy IFF {segmentThreshold} >= #segments (default: 300, to disable use: 0)
- count:
- commitIntervalMsec: Wait at least this many milliseconds between committing index data changes and making them visible to queries (default: 60000, to disable use: 0). For the case where there are a lot of inserts/updates, a lower value, until commit, will cause the index not to account for them and memory usage would continue to grow. For the case where there are a few inserts/updates, a higher value will impact performance and waste disk space for each commit call without any added benefits.
- consolidate:
- threadMaxTotal: Maximum total number of threads (>0) for single-run tasks (default: 5). For the case where there are a lot of parallelizable tasks and an abundance of resources, a lower value would limit performance. For the case where there are limited resources CPU/memory, a higher value will negatively impact performance.
- threadMaxIdle: Maximum idle number of threads for single-run tasks (default: 5). For the case where there are a lot of short-lived asynchronous tasks, a lower value will cause a lot of thread creation/deletion calls. For the case where there are no short-lived asynchronous tasks, a higher value will only waste memory.
- links:
- collection-name:
- analyzers (string): The list of analyzers to be used for indexing of string values (default: ["identity"]).
- [field-name]:
- analyzers (string): The list of analyzers to be used for indexing of string values (default: ["identity"]).
- [field-name]: Specify properties for nested fields here
- includeAllFields: The flag determines whether or not to index all fields on a particular level of depth (default: false).
- trackListPositions: The flag determines whether or not values in a lists should be treated separate (default: false).
- includeAllFields: The flag determines whether or not to index all fields on a particular level of depth (default: false).
- trackListPositions: The flag determines whether or not values in a lists should be treated separate (default: false).
- collection-name:
Changes the properties of a view.
On success an object with the following attributes is returned:
- id: The identifier of the view.
- name: The name of the view.
- type: The view type. Valid types are:
- arangosearch: ArangoSearch view
- properties: The updated properties of the view.
Return Codes
400: If the view-name is missing, then a HTTP 400 is returned.
404: If the view-name is unknown, then a HTTP 404 is returned.
Examples
shell> curl -X PATCH --data-binary @- --dump - http://localhost:8529/_api/view/products/properties <<EOF
{
"threadMaxIdle" : 10
}
EOF
HTTP/1.1 200 OK
content-type: application/json; charset=utf-8
x-content-type-options: nosniff
{
"id" : "12832",
"name" : "products",
"type" : "arangosearch"
}
shell> curl -X PATCH --data-binary @- --dump - http://localhost:8529/_api/view/products/properties <<EOF
{
"threadMaxIdle" : 10
}
EOF
HTTP/1.1 200 OK
content-type: application/json; charset=utf-8
x-content-type-options: nosniff