[api] regenerate
This commit is contained in:
@ -286,82 +286,6 @@ client.create({
|
||||
---------
|
||||
|
||||
|
||||
*Params*
|
||||
|
||||
[horizontal]
|
||||
`waitForActiveShards`::
|
||||
`String` -- Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)
|
||||
`parent`::
|
||||
`String` -- ID of the parent document
|
||||
`refresh`::
|
||||
`String` -- If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes.
|
||||
Options:::
|
||||
* `"true"`
|
||||
* `"false"`
|
||||
* `"wait_for"`
|
||||
* `""`
|
||||
|
||||
`routing`::
|
||||
`String` -- Specific routing value
|
||||
`timeout`::
|
||||
`Date, Number` -- Explicit operation timeout
|
||||
`timestamp`::
|
||||
`Date, Number` -- Explicit timestamp for the document
|
||||
`ttl`::
|
||||
`Date, Number` -- Expiration time for the document
|
||||
`version`::
|
||||
`Number` -- Explicit version number for concurrency control
|
||||
`versionType`::
|
||||
`String` -- Specific version type
|
||||
Options:::
|
||||
* `"internal"`
|
||||
* `"external"`
|
||||
* `"external_gte"`
|
||||
* `"force"`
|
||||
|
||||
`pipeline`::
|
||||
`String` -- The pipeline id to preprocess incoming documents with
|
||||
`id`::
|
||||
`String` -- Document ID
|
||||
`index`::
|
||||
`String` -- The name of the index
|
||||
`type`::
|
||||
`String` -- The type of the document
|
||||
|
||||
link:#[back to top]
|
||||
|
||||
[[api-create]]
|
||||
=== `create`
|
||||
|
||||
[source,js]
|
||||
--------
|
||||
client.create([params, [callback]])
|
||||
--------
|
||||
|
||||
Adds a typed JSON document in a specific index, making it searchable. If a document with the same `index`, `type`, and `id` already exists, an error will occur.
|
||||
|
||||
The default method is `POST` and the usual <<api-conventions,params and return values>> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html[the elasticsearch docs] for more about this method.
|
||||
|
||||
.Create a document
|
||||
[source,js]
|
||||
---------
|
||||
client.create({
|
||||
index: 'myindex',
|
||||
type: 'mytype',
|
||||
id: '1',
|
||||
body: {
|
||||
title: 'Test 1',
|
||||
tags: ['y', 'z'],
|
||||
published: true,
|
||||
published_at: '2013-01-01',
|
||||
counter: 1
|
||||
}
|
||||
}, function (error, response) {
|
||||
// ...
|
||||
});
|
||||
---------
|
||||
|
||||
|
||||
*Params*
|
||||
|
||||
[horizontal]
|
||||
@ -1060,6 +984,12 @@ client.index({
|
||||
[horizontal]
|
||||
`waitForActiveShards`::
|
||||
`String` -- Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)
|
||||
`[opType=index]`::
|
||||
`String` -- Explicit operation type
|
||||
Options:::
|
||||
* `"index"`
|
||||
* `"create"`
|
||||
|
||||
`parent`::
|
||||
`String` -- ID of the parent document
|
||||
`refresh`::
|
||||
|
||||
@ -694,6 +694,12 @@ Options:::
|
||||
* `"quorum"`
|
||||
* `"all"`
|
||||
|
||||
`[opType=index]`::
|
||||
`String` -- Explicit operation type
|
||||
Options:::
|
||||
* `"index"`
|
||||
* `"create"`
|
||||
|
||||
`parent`::
|
||||
`String` -- ID of the parent document
|
||||
`percolate`::
|
||||
|
||||
@ -763,6 +763,12 @@ Options:::
|
||||
* `"quorum"`
|
||||
* `"all"`
|
||||
|
||||
`[opType=index]`::
|
||||
`String` -- Explicit operation type
|
||||
Options:::
|
||||
* `"index"`
|
||||
* `"create"`
|
||||
|
||||
`parent`::
|
||||
`String` -- ID of the parent document
|
||||
`refresh`::
|
||||
|
||||
@ -773,6 +773,12 @@ Options:::
|
||||
* `"quorum"`
|
||||
* `"all"`
|
||||
|
||||
`[opType=index]`::
|
||||
`String` -- Explicit operation type
|
||||
Options:::
|
||||
* `"index"`
|
||||
* `"create"`
|
||||
|
||||
`parent`::
|
||||
`String` -- ID of the parent document
|
||||
`refresh`::
|
||||
|
||||
@ -773,6 +773,12 @@ Options:::
|
||||
* `"quorum"`
|
||||
* `"all"`
|
||||
|
||||
`[opType=index]`::
|
||||
`String` -- Explicit operation type
|
||||
Options:::
|
||||
* `"index"`
|
||||
* `"create"`
|
||||
|
||||
`parent`::
|
||||
`String` -- ID of the parent document
|
||||
`refresh`::
|
||||
|
||||
@ -869,6 +869,12 @@ Options:::
|
||||
* `"quorum"`
|
||||
* `"all"`
|
||||
|
||||
`[opType=index]`::
|
||||
`String` -- Explicit operation type
|
||||
Options:::
|
||||
* `"index"`
|
||||
* `"create"`
|
||||
|
||||
`parent`::
|
||||
`String` -- ID of the parent document
|
||||
`refresh`::
|
||||
|
||||
@ -917,6 +917,12 @@ Options:::
|
||||
* `"quorum"`
|
||||
* `"all"`
|
||||
|
||||
`[opType=index]`::
|
||||
`String` -- Explicit operation type
|
||||
Options:::
|
||||
* `"index"`
|
||||
* `"create"`
|
||||
|
||||
`parent`::
|
||||
`String` -- ID of the parent document
|
||||
`refresh`::
|
||||
|
||||
@ -917,6 +917,12 @@ Options:::
|
||||
* `"quorum"`
|
||||
* `"all"`
|
||||
|
||||
`[opType=index]`::
|
||||
`String` -- Explicit operation type
|
||||
Options:::
|
||||
* `"index"`
|
||||
* `"create"`
|
||||
|
||||
`parent`::
|
||||
`String` -- ID of the parent document
|
||||
`refresh`::
|
||||
|
||||
@ -970,6 +970,12 @@ Options:::
|
||||
* `"quorum"`
|
||||
* `"all"`
|
||||
|
||||
`[opType=index]`::
|
||||
`String` -- Explicit operation type
|
||||
Options:::
|
||||
* `"index"`
|
||||
* `"create"`
|
||||
|
||||
`parent`::
|
||||
`String` -- ID of the parent document
|
||||
`refresh`::
|
||||
|
||||
@ -970,6 +970,12 @@ Options:::
|
||||
* `"quorum"`
|
||||
* `"all"`
|
||||
|
||||
`[opType=index]`::
|
||||
`String` -- Explicit operation type
|
||||
Options:::
|
||||
* `"index"`
|
||||
* `"create"`
|
||||
|
||||
`parent`::
|
||||
`String` -- ID of the parent document
|
||||
`refresh`::
|
||||
|
||||
@ -864,6 +864,12 @@ Options:::
|
||||
* `"quorum"`
|
||||
* `"all"`
|
||||
|
||||
`[opType=index]`::
|
||||
`String` -- Explicit operation type
|
||||
Options:::
|
||||
* `"index"`
|
||||
* `"create"`
|
||||
|
||||
`parent`::
|
||||
`String` -- ID of the parent document
|
||||
`refresh`::
|
||||
|
||||
@ -864,6 +864,12 @@ Options:::
|
||||
* `"quorum"`
|
||||
* `"all"`
|
||||
|
||||
`[opType=index]`::
|
||||
`String` -- Explicit operation type
|
||||
Options:::
|
||||
* `"index"`
|
||||
* `"create"`
|
||||
|
||||
`parent`::
|
||||
`String` -- ID of the parent document
|
||||
`refresh`::
|
||||
|
||||
@ -864,6 +864,12 @@ Options:::
|
||||
* `"quorum"`
|
||||
* `"all"`
|
||||
|
||||
`[opType=index]`::
|
||||
`String` -- Explicit operation type
|
||||
Options:::
|
||||
* `"index"`
|
||||
* `"create"`
|
||||
|
||||
`parent`::
|
||||
`String` -- ID of the parent document
|
||||
`refresh`::
|
||||
|
||||
@ -864,6 +864,12 @@ Options:::
|
||||
* `"quorum"`
|
||||
* `"all"`
|
||||
|
||||
`[opType=index]`::
|
||||
`String` -- Explicit operation type
|
||||
Options:::
|
||||
* `"index"`
|
||||
* `"create"`
|
||||
|
||||
`parent`::
|
||||
`String` -- ID of the parent document
|
||||
`refresh`::
|
||||
|
||||
@ -864,6 +864,12 @@ Options:::
|
||||
* `"quorum"`
|
||||
* `"all"`
|
||||
|
||||
`[opType=index]`::
|
||||
`String` -- Explicit operation type
|
||||
Options:::
|
||||
* `"index"`
|
||||
* `"create"`
|
||||
|
||||
`parent`::
|
||||
`String` -- ID of the parent document
|
||||
`refresh`::
|
||||
|
||||
Reference in New Issue
Block a user