8000 Added zkd index docu block. (#13698) · arangodb/arangodb@bbf25b4 · GitHub
[go: up one dir, main page]

Skip to content

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit bbf25b4

Browse files
author
Lars Maier
authored
Added zkd index docu block. (#13698)
1 parent 8cabd6f commit bbf25b4

File tree

1 file changed

+68
-0
lines changed

1 file changed

+68
-0
lines changed
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
2+
@startDocuBlock post_api_index_zkd
3+
@brief creates a multi-dimensional index
4+
5+
@RESTHEADER{POST /_api/index#multi-dim, Create multi-dimensional index, createIndex#multi-dim}
6+
7+
@RESTQUERYPARAMETERS
8+
9+
@RESTQUERYPARAM{collection,string,required}
10+
The collection name.
11+
12+
@RESTBODYPARAM{type,string,required,string}
13+
must be equal to *"zkd"*.
14+
15+
@RESTBODYPARAM{fields,array,required,string}
16+
an array of attribute names used for each dimension. Array expansions are not allowed.
17+
18+
@RESTBODYPARAM{unique,boolean,required,}
19+
if *true*, then create a unique index.
20+
21+
@RESTBODYPARAM{fieldValueTypes,string,required,string}
22+
must be equal to *"double"*. Currently only doubles are supported as values.
23+
24+
@RESTDESCRIPTION
25+
Creates a multi-dimensional index for the collection *collection-name*, if
26+
it does not already exist. The call expects an object containing the index
27+
details.
28+
29+
@RESTRETURNCODES
30+
31+
@RESTRETURNCODE{200}
32+
If the index already exists, then a *HTTP 200* is
33+
returned.
34+
35+
@RESTRETURNCODE{201}
36+
If the index does not already exist and could be created, then a *HTTP 201*
37+
is returned.
38+
39+
@RESTRETURNCODE{404}
40+
If the *collection-name* is unknown, then a *HTTP 404* is returned.
41+
42+
@RESTRETURNCODE{400}
43+
If the index definition is invalid, then a *HTTP 400* is returned.
44+
45+
@EXAMPLES
46+
47+
Creating a multi-dimensional index
48+
49+
@EXAMPLE_ARANGOSH_RUN{RestIndexCreateNewFulltext}
50+
var cn = "intervals";
51+
db._drop(cn);
52+
db._create(cn);
53+
54+
var url = "/_api/index?collection=" + cn;
55+
var body = {
56+
type: "zkd",
57+
fields: [ "from", "to" ],
58+
fieldValueTypes: "double"
59+
};
60+
61+
var response = logCurlRequest('POST', url, body);
62+
63+
assert(response.code === 201);
64+
65+
logJsonResponse(response);
66+
~ db._drop(cn);
67+
@END_EXAMPLE_ARANGOSH_RUN
68+
@endDocuBlock

0 commit comments

Comments
 (0)
0