createIndex #
Create a new empty index, with no associated mapping.
createIndex([index], [options], callback) #
Arguments | Type | Description |
---|---|---|
index | string | Optional index to query. If no set, defaults to Kuzzle.defaultIndex |
options | JSON object | Optional parameters |
callback | function | Callback handling the response |
Options #
Option | Type | Description | Default |
---|---|---|---|
queuable | boolean | Make this request queuable or not | true |
Callback Response #
Returns an object with the index creation status.
Usage #
kuzzle.createIndex("myIndex", new ResponseListener<Boolean>() {
@Override
public void onSuccess(JSONObject result) {
// result var contains the creation status of myIndex.
}
@Override
public void onError(JSONObject error) {
// Handle error
}
}
Callback response:
{
"acknowledged": true,
"shards_acknowledged": true
}
Edit this page on Github(opens new window)