/ create,
/ collectionCreate a collection # Creates a new collection.
Examples # The following request creates a new collection called my-collection in the namespace my-namespace:
PUT /my-namespace:my-collection If creating a collection within the default namespace, it can be simplified as:
PUT /my-collection Request # PUT /[<namespace>:]<name> Path parameters # <namespace>
(Optional, string) The namespace which the collection belongs to. Namespace names must meet the following criteria: Lowercase only Cannot include \ /, *, ?
...
/ create,
/ indexCreate a document # Creates a new document.
Examples # Insert a JSON document into the my-collection collection:
POST /my-collection/_doc { "message": "GET /search HTTP/1.1 200 1070000", "org": { "id": "infini" } } The API returns the following result:
{ "_id": "0,0", "_version": 1, "_namespace": "default", "_collection": "my-collection", "result": "created", ... } The API supports passing a customized UUID as the document identify, eg:
POST /my-collection/_doc/news_001 { "message": "GET /search HTTP/1.
...
/ create,
/ namespaceCreate a namespace # Creates a new namespace.
Examples # If creating a website namespace, the following request creates a new namespace called website:
PUT /_namespace/website Request # PUT /_namespace/<name> Path parameters # <name>
(Required, string) The name of the namespace. Namespace names must meet the following criteria: Lowercase only Cannot include \ /, *, ?, ", <, >, |, , ,, # Cannot start with -, _, + Cannot be .
...
/ create,
/ indexCreate an index # Creates a new index under a collectioin.
Examples # The following request creates a new index called my-index under collection my-namespace:my-collection
PUT /my-namespace:my-collection/_index/my_index Request # PUT /<target>/_index/<name> Path parameters # <target>
(Required, string) The collection which the index belongs to.
<name>
(Required, string) Name of the index you wish to create.