ArangoDB v3.10 reached End of Life (EOL) and is no longer supported.
This documentation is outdated. Please see the most recent stable version.
HTTP interface for search-alias Views
The HTTP API for Views lets you manage search-alias
Views, including adding and removing inverted indexes
Create a search-alias View
Examples
curl -X POST --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/view
{
"name": "products",
"type": "search-alias",
"indexes": [
{
"collection": "books",
"index": "inv-idx"
}
]
}
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: 148
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" : "h1617A8BD8EEE/71483",
"id" : "71483",
"name" : "products",
"type" : "search-alias",
"indexes" : [
{
"collection" : "books",
"index" : "inv-idx"
}
]
}
Get information about a View
The result is an object briefly describing the View with the following attributes:
id
: The identifier of the Viewname
: The name of the Viewtype
: The type of the View as string
Examples
Using an identifier:
curl --header 'accept: application/json' --dump - http://localhost:8529/_api/view/71485
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: 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" : "71485",
"globallyUniqueId" : "h1617A8BD8EEE/71485"
}
Using a name:
curl --header 'accept: application/json' --dump - http://localhost:8529/_api/view/productsView
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: 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" : "71489",
"globallyUniqueId" : "h1617A8BD8EEE/71489"
}
Read properties of a View
Returns an object containing the definition of the View identified by view-name.
The result is an object with a full description of a specific View, including View type dependent properties.
Examples
Using an identifier:
curl --header 'accept: application/json' --dump - http://localhost:8529/_api/view/71501/properties
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: 177
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" : "search-alias",
"name" : "productsView",
"indexes" : [
{
"collection" : "books",
"index" : "inv-idx"
}
],
"id" : "71501",
"globallyUniqueId" : "h1617A8BD8EEE/71501"
}
Using a name:
curl --header 'accept: application/json' --dump - http://localhost:8529/_api/view/productsView/properties
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: 177
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" : "search-alias",
"name" : "productsView",
"indexes" : [
{
"collection" : "books",
"index" : "inv-idx"
}
],
"id" : "71511",
"globallyUniqueId" : "h1617A8BD8EEE/71511"
}
List all Views
Returns an object containing a listing of all Views in a database, regardless of their type. It is an array of objects with the following attributes:
id
name
type
Examples
Return information about all Views:
curl --header 'accept: application/json' --dump - http://localhost:8529/_api/view
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: 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" : "h1617A8BD8EEE/128",
"id" : "128",
"name" : "demoView",
"type" : "arangosearch"
},
{
"globallyUniqueId" : "h1617A8BD8EEE/71513",
"id" : "71513",
"name" : "productsView",
"type" : "search-alias"
},
{
"globallyUniqueId" : "h1617A8BD8EEE/71514",
"id" : "71514",
"name" : "reviewsView",
"type" : "arangosearch"
}
]
}
Replace the properties of a search-alias View
search-alias
View.Examples
curl -X PUT --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/view/productsView/properties
{
"indexes": [
{
"collection": "books",
"index": "inv_descr"
}
]
}
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: 154
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" : "h1617A8BD8EEE/71530",
"id" : "71530",
"name" : "productsView",
"type" : "search-alias",
"indexes" : [
{
"collection" : "books",
"index" : "inv_descr"
}
]
}
Update the properties of a search-alias View
search-alias
View.Examples
curl -X PATCH --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/view/productsView/properties
{
"indexes": [
{
"collection": "books",
"index": "inv_descr"
}
]
}
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: 197
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" : "h1617A8BD8EEE/71543",
"id" : "71543",
"name" : "productsView",
"type" : "search-alias",
"indexes" : [
{
"collection" : "books",
"index" : "inv_title"
},
{
"collection" : "books",
"index" : "inv_descr"
}
]
}
Rename a View
Renames a View. Expects an object with the attribute(s)
name
: The new name
It returns an object with the attributes
id
: The identifier of the View.name
: The new name of the View.type
: The View type.
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: 474
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" : "h1617A8BD8EEE/71545",
"id" : "71545",
"name" : "catalogView",
"type" : "arangosearch",
"cleanupIntervalStep" : 2,
"commitIntervalMsec" : 1000,
"consolidationIntervalMsec" : 1000,
"consolidationPolicy" : {
"type" : "tier",
"segmentsBytesFloor" : 2097152,
"segmentsBytesMax" : 5368709120,
"segmentsMax" : 10,
"segmentsMin" : 1,
"minScore" : 0
},
"primarySort" : [ ],
"primarySortCompression" : "lz4",
"storedValues" : [ ],
"writebufferActive" : 0,
"writebufferIdle" : 64,
"writebufferSizeMax" : 33554432,
"links" : {
}
}
Drop a View
Drops the View identified by view-name
.
If the View was successfully dropped, an object is returned with the following attributes:
error
:false
id
: The identifier of the dropped View
Examples
Using an identifier:
curl -X DELETE --header 'accept: application/json' --dump - http://localhost:8529/_api/view/71551
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: 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/productsView
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: 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
}