8000 [zkd] DocuBlock by maierlars · Pull Request #13698 · arangodb/arangodb · GitHub
[go: up one dir, main page]

Skip to content

[zkd] DocuBlock #13698

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 15, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions Documentation/DocuBlocks/Rest/Indexes/post_api_index_zkd.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@

@startDocuBlock post_api_index_zkd
@brief creates a multi-dimensional index

@RESTHEADER{POST /_api/index#multi-dim, Create multi-dimensional index, createIndex#multi-dim}

@RESTQUERYPARAMETERS

@RESTQUERYPARAM{collection,string,required}
The collection name.

@RESTBODYPARAM{type,string,required,string}
must be equal to *"zkd"*.

@RESTBODYPARAM{fields,array,required,string}
an array of attribute names used for each dimension. Array expansions are not allowed.

@RESTBODYPARAM{unique,boolean,required,}
if *true*, then create a unique index.

@RESTBODYPARAM{fieldValueTypes,string,required,string}
must be equal to *"double"*. Currently only doubles are supported as values.

@RESTDESCRIPTION
Creates a multi-dimensional index for the collection *collection-name*, if
it does not already exist. The call expects an object containing the index
details.

@RESTRETURNCODES

@RESTRETURNCODE{200}
If the index already exists, then a *HTTP 200* is
returned.

@RESTRETURNCODE{201}
If the index does not already exist and could be created, then a *HTTP 201*
is returned.

@RESTRETURNCODE{404}
If the *collection-name* is unknown, then a *HTTP 404* is returned.

@RESTRETURNCODE{400}
If the index definition is invalid, then a *HTTP 400* is returned.

@EXAMPLES

Creating a multi-dimensional index

@EXAMPLE_ARANGOSH_RUN{RestIndexCreateNewFulltext}
var cn = "intervals";
db._drop(cn);
db._create(cn);

var url = "/_api/index?collection=" + cn;
var body = {
type: "zkd",
fields: [ "from", "to" ],
fieldValueTypes: "double"
};

var response = logCurlRequest('POST', url, body);

assert(response.code === 201);

logJsonResponse(response);
~ db._drop(cn);
@END_EXAMPLE_ARANGOSH_RUN
@endDocuBlock
0