updated integration suite to pull rest-api-spec from elasticsearch repo

This commit is contained in:
Spencer Alger
2014-01-02 11:33:59 -07:00
parent 6c2330fd8a
commit 71a0b8f58e
13 changed files with 391 additions and 425 deletions

6
.gitmodules vendored
View File

@ -1,3 +1,3 @@
[submodule "src/rest-api-spec"]
path = src/rest-api-spec
url = git://github.com/elasticsearch/elasticsearch-rest-api-spec.git
[submodule "src/elasticsearch"]
path = src/elasticsearch
url = https://github.com/elasticsearch/elasticsearch.git

View File

@ -12,27 +12,11 @@ The process for contributing to any of the Elasticsearch repositories is similar
2. When you're ready to run the tests
Call `npm test` which executes `scripts/run_tests.js`.
```sh
$ node scripts/run_tests.js --help
Runner for the Elasticsearch.js Unit and Integration tests in both node and the browser.
Specify --no-{{flag}} to negate it.
Options:
--server [true]
--browser [true]
--unit [true]
--integration [false]
--port [9200]
--host ["localhost"] hostname for elasticsearch instance used in integration tests
--check-upstream [false] check for remote updates to the yaml test suite
```
Integration and unit tests can be run by simply calling `npm test` or `grunt test`, but the integration tests require a running instance of elasticsearch and ***WILL WIPE ALL DATA FROM ELASTICSEARCH***. If you only want to run the unit tests, run `grunt unit_test` instead. Travis and Jenkins run the integration tests so your changes can be verified before they are merged.
3. Submit a pull request
Push your local changes to your forked copy of the repository and submit a pull request. In the pull request, describe what your changes do and be sure to link to any conversations regarding this implementation, eg "Closes #123".
Push your local changes a forked copy of the repository and submit a pull request. In the pull request, describe what your changes do and be sure to link to any conversations regarding this implementation, eg "Closes #123".
4. Sign the CLA

View File

@ -424,8 +424,12 @@ client.count(
==== Params
[horizontal]
`[ignoreIndices=none]`::
`String` -- When performed on multiple indices, allows to ignore `missing` ones
`ignoreUnavailable`::
`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed)
`allowNoIndices`::
`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
`[expandWildcards=open]`::
`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both.
`minScore`::
`Number` -- Include only documents with a specific `_score` value in the result
`preference`::
@ -602,8 +606,12 @@ client.delete_by_query({
`String` -- The default operator for query string query (AND or OR)
`df`::
`String` -- The field to use as default where no field prefix is given in the query string
`[ignoreIndices=none]`::
`String` -- When performed on multiple indices, allows to ignore `missing` ones
`ignoreUnavailable`::
`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed)
`allowNoIndices`::
`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
`[expandWildcards=open]`::
`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both.
`[replication=sync]`::
`String` -- Specific replication type
`q`::
@ -984,8 +992,12 @@ The default method is `POST` and the usual <<api-conventions,params and return v
`Boolean` -- Clear ID caches for parent/child
`idCache`::
`Boolean` -- Clear ID caches for parent/child
`[ignoreIndices=none]`::
`String` -- When performed on multiple indices, allows to ignore `missing` ones
`ignoreUnavailable`::
`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed)
`allowNoIndices`::
`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
`[expandWildcards=open]`::
`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both.
`index`::
`String, String[], Boolean` -- A comma-separated list of index name to limit the operation
`recycler`::
@ -1209,8 +1221,12 @@ The default method is `HEAD` and the usual <<api-conventions,params and return v
==== Params
[horizontal]
`[ignoreIndices=none]`::
`String` -- When performed on multiple indices, allows to ignore `missing` ones
`ignoreUnavailable`::
`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed)
`allowNoIndices`::
`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
`[expandWildcards=open,closed]`::
`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both.
`index`::
`String, String[], Boolean` -- A comma-separated list of index names to filter aliases
`name`::
@ -1234,8 +1250,12 @@ The default method is `HEAD` and the usual <<api-conventions,params and return v
==== Params
[horizontal]
`[ignoreIndices=none]`::
`String` -- When performed on multiple indices, allows to ignore `missing` ones
`ignoreUnavailable`::
`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed)
`allowNoIndices`::
`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
`[expandWildcards=open]`::
`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both.
`index`::
`String, String[], Boolean` -- A comma-separated list of index names; use `_all` to check the types across all indices
`type`::
@ -1263,8 +1283,12 @@ The default method is `POST` and the usual <<api-conventions,params and return v
`Boolean` -- TODO: ?
`full`::
`Boolean` -- TODO: ?
`[ignoreIndices=none]`::
`String` -- When performed on multiple indices, allows to ignore `missing` ones
`ignoreUnavailable`::
`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed)
`allowNoIndices`::
`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
`[expandWildcards=open]`::
`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both.
`refresh`::
`Boolean` -- Refresh the index after performing the operation
`index`::
@ -1288,36 +1312,17 @@ The default method is `GET` and the usual <<api-conventions,params and return va
==== Params
[horizontal]
`[ignoreIndices=none]`::
`String` -- When performed on multiple indices, allows to ignore `missing` ones
`ignoreUnavailable`::
`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed)
`allowNoIndices`::
`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
`[expandWildcards=open]`::
`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both.
`index`::
`String, String[], Boolean` -- A comma-separated list of index names to filter aliases
`name`::
`String, String[], Boolean` -- A comma-separated list of alias names to return
[[api-indices-getaliases]]
=== `indices.getAliases`
[source,js]
--------
client.indices.getAliases([params, [callback]])
--------
Retrieve specified aliases
The default method is `GET` and the usual <<api-conventions,params and return values>> apply. See http://www.elasticsearch.org/guide/reference/api/admin-indices-aliases/[the elasticsearch docs] for more about this method.
// no examples
==== Params
[horizontal]
`timeout`::
`Date, Number` -- Explicit operation timeout
`index`::
`String, String[], Boolean` -- A comma-separated list of index names to filter aliases
[[api-indices-getfieldmapping]]
=== `indices.getFieldMapping`
@ -1480,8 +1485,12 @@ The default method is `POST` and the usual <<api-conventions,params and return v
[horizontal]
`flush`::
`Boolean` -- Specify whether the index should be flushed after performing the operation (default: true)
`[ignoreIndices=none]`::
`String` -- When performed on multiple indices, allows to ignore `missing` ones
`ignoreUnavailable`::
`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed)
`allowNoIndices`::
`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
`[expandWildcards=open]`::
`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both.
`maxNumSegments`::
`Number` -- The number of segments the index should be merged into (default: dynamic)
`onlyExpungeDeletes`::
@ -1646,8 +1655,12 @@ The default method is `POST` and the usual <<api-conventions,params and return v
==== Params
[horizontal]
`[ignoreIndices=none]`::
`String` -- When performed on multiple indices, allows to ignore `missing` ones
`ignoreUnavailable`::
`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed)
`allowNoIndices`::
`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
`[expandWildcards=open]`::
`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both.
`operationThreading`::
`Anything` -- TODO: ?
`index`::
@ -1671,8 +1684,12 @@ The default method is `GET` and the usual <<api-conventions,params and return va
==== Params
[horizontal]
`[ignoreIndices=none]`::
`String` -- When performed on multiple indices, allows to ignore `missing` ones
`ignoreUnavailable`::
`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed)
`allowNoIndices`::
`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
`[expandWildcards=open]`::
`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both.
`operationThreading`::
`Anything` -- TODO: ?
`index`::
@ -1696,8 +1713,12 @@ The default method is `POST` and the usual <<api-conventions,params and return v
==== Params
[horizontal]
`[ignoreIndices=none]`::
`String` -- When performed on multiple indices, allows to ignore `missing` ones
`ignoreUnavailable`::
`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed)
`allowNoIndices`::
`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
`[expandWildcards=open]`::
`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both.
`index`::
`String, String[], Boolean` -- A comma-separated list of index names; use `_all` or empty string for all indices
@ -1745,8 +1766,12 @@ The default method is `GET` and the usual <<api-conventions,params and return va
`Boolean` -- A comma-separated list of search groups for `search` statistics
`idCache`::
`Boolean` -- Return information about ID cache
`[ignoreIndices=none]`::
`String` -- When performed on multiple indices, allows to ignore `missing` ones
`ignoreUnavailable`::
`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed)
`allowNoIndices`::
`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
`[expandWildcards=open]`::
`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both.
`indexing`::
`Boolean` -- Return information about indexing operations
`merge`::
@ -1786,8 +1811,12 @@ The default method is `GET` and the usual <<api-conventions,params and return va
==== Params
[horizontal]
`[ignoreIndices=none]`::
`String` -- When performed on multiple indices, allows to ignore `missing` ones
`ignoreUnavailable`::
`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed)
`allowNoIndices`::
`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
`[expandWildcards=open]`::
`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both.
`operationThreading`::
`Anything` -- TODO: ?
`recovery`::
@ -1842,8 +1871,12 @@ The default method is `POST` and the usual <<api-conventions,params and return v
[horizontal]
`explain`::
`Boolean` -- Return detailed information about the error
`[ignoreIndices=none]`::
`String` -- When performed on multiple indices, allows to ignore `missing` ones
`ignoreUnavailable`::
`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed)
`allowNoIndices`::
`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
`[expandWildcards=open]`::
`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both.
`operationThreading`::
`Anything` -- TODO: ?
`source`::
@ -2262,8 +2295,12 @@ client.search({
`String, String[], Boolean` -- A comma-separated list of fields to return as part of a hit
`from`::
`Number` -- Starting offset (default: 0)
`[ignoreIndices=none]`::
`String` -- When performed on multiple indices, allows to ignore `missing` ones
`ignoreUnavailable`::
`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed)
`allowNoIndices`::
`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
`[expandWildcards=open]`::
`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both.
`indicesBoost`::
`String, String[], Boolean` -- Comma-separated list of index boosts
`lenient`::
@ -2362,8 +2399,12 @@ body: {
==== Params
[horizontal]
`[ignoreIndices=none]`::
`String` -- When performed on multiple indices, allows to ignore `missing` ones
`ignoreUnavailable`::
`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed)
`allowNoIndices`::
`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
`[expandWildcards=open]`::
`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both.
`preference`::
`String` -- Specify the node or shard the operation should be performed on (default: random)
`routing`::

View File

@ -1,24 +1,23 @@
module.exports = {
generate: {
exec: 'node scripts/generate'
options: {
cwd: './scripts'
},
browser_unit_tests: {
exec: 'node scripts/run_tests --unit --no-server',
generate: {
exec: 'node generate'
},
browser_integration_tests: {
exec: 'node run_browser_integration_suite',
options: {
cwd: '.',
passArgs: [
'port',
'host'
'browsers'
]
}
},
browser_integration_tests: {
exec: 'node scripts/run_tests --integration --no-server',
browser_unit_tests: {
exec: './node_modules/.bin/testling .',
options: {
cwd: '.',
passArgs: [
'port',
'host'
'x'
]
}
}

View File

@ -16,6 +16,11 @@ module.exports = function (grunt) {
'mochacov:integration',
]);
grunt.registerTask('unit_test', [
'jshint',
'mochacov:unit'
]);
grunt.registerTask('coverage', [
'mochacov:make_coverage_html',
'open:coverage'

View File

@ -28,7 +28,7 @@ module.exports = function (done) {
], done);
function readSpecFiles(done) {
var apiDir = '../../src/rest-api-spec/api/';
var apiDir = '../../src/elasticsearch/rest-api-spec/api/';
files = fs.readdirSync(apiDir).map(function (filename) {
return require(apiDir + filename);
});

View File

@ -16,7 +16,7 @@ module.exports = function (done) {
], done);
function readYamlTests(done) {
var testDir = path.join(__dirname, '../../src/rest-api-spec/test/');
var testDir = path.join(__dirname, '../../src/elasticsearch/rest-api-spec/test/');
function readDirectories(dir) {
fs.readdirSync(dir).forEach(function (filename) {

View File

@ -1,70 +0,0 @@
var https = require('https');
var request = {
hostname: 'api.github.com',
path: '/repos/elasticsearch/elasticsearch-rest-api-spec/commits/HEAD',
headers: {
'User-Agent': 'spenceralger'
}
};
var fs = require('fs');
var lastRestSpecUpdateFile = __dirname + '/last_rest_spec_update.sha';
var lastRestSpecUpdate;
var updated;
if (fs.existsSync(lastRestSpecUpdateFile)) {
lastRestSpecUpdate = fs.readFileSync(lastRestSpecUpdateFile, 'utf8');
}
var req = https.get(request, function (incoming) {
if (incoming.statusCode !== 200) {
req.abort();
console.error('request for last commit failed', incoming.statusCode, incoming.headers);
return;
}
var body = '';
incoming.on('data', onData);
incoming.on('end', onEnd);
function onData(chunk) {
body += chunk;
}
function onEnd() {
incoming.removeListener('data', onData);
incoming.removeListener('end', onEnd);
var _req = req;
req = null;
var resp;
try {
resp = JSON.parse(body);
} catch (e) {
console.log('unable to parse response from github');
_req.emit('ready');
return;
}
if (lastRestSpecUpdate === resp.sha) {
updated = false;
} else {
updated = true;
fs.writeFileSync(lastRestSpecUpdateFile, resp.sha);
}
_req.emit('ready');
}
});
module.exports = function (cb) {
function done() {
cb(null, updated);
}
if (req) {
req.on('ready', done);
} else {
process.nextTick(done);
}
};

View File

@ -1,144 +0,0 @@
var async = require('async');
var cp = require('child_process');
var chalk = require('chalk');
var argv = require('optimist')
.usage([
'Runner for the Elasticsearch.js unit and integration tests in both node and the browser.',
'To negate a flag you can use --no-{{flag}}.',
'',
'Examples:',
'',
'# Before a commit (unit tests in Node & Phantom + integration in Chrome & Firefox):',
'npm test --unit --integration --browsers=chrome,firefox',
'',
'# After a change in the rest-spec:',
'npm test --no-unit --integration --browsers=chrome,firefox --check-upstream',
'',
'# During dev (just Node unit tests):',
'npm test --no-browsers',
''
].join('\n'))
.options({
server: {
default: true,
alias: 's'
},
unit: {
default: false,
alias: 'u'
},
integration: {
default: false,
alias: 'i'
},
host: {
default: 'localhost',
description: 'hostname for elasticsearch instance used in integration tests'
},
port: {
default: 9200,
alias: 'p'
},
browsers: {
default: '*',
alias: 'b'
},
'check-upstream': {
default: false,
description: 'check for remote updates to the yaml test suite'
}
});
if (process.argv.indexOf('help') + process.argv.indexOf('--help') + process.argv.indexOf('-h') !== -3) {
argv.showHelp();
process.exit(1);
}
if (process.env.npm_config_argv) {
// when called by NPM
argv = argv.parse([].concat(process.argv).concat(JSON.parse(process.env.npm_config_argv).original));
} else {
// when called directly
argv = argv.argv;
}
var commands = [];
var command;
if (argv['check-upstream']) {
command = ['node', 'scripts/generate'];
if (argv.force) {
command.push('--force');
}
commands.push(command);
}
if (argv.unit) {
if (argv.server) {
commands.push(['./node_modules/.bin/mocha', 'test/unit/test_*.js', '--require should']);
}
if (argv.browsers) {
commands.push(['./node_modules/.bin/testling', '.']);
}
}
if (argv.integration) {
if (argv.server) {
commands.push([
'./node_modules/.bin/mocha',
'test/integration/yaml_suite/index.js',
// '-b',
'--require', 'should',
'--host', argv.host,
'--port', argv.port
].filter(Boolean));
}
if (argv.browsers) {
commands.push([
'node',
'scripts/run_browser_integration_suite/index.js',
'--browsers',
argv.browsers
]);
}
}
var proc = null;
process.on('exit', function () {
if (proc && proc.kill) {
proc.kill();
}
});
if (commands.length) {
async.forEachSeries(commands, function (args, done) {
var command = args.shift();
console.log(chalk.gray.bold('\n\n' + '# ' + command + ' ' + args.join(' ')));
proc = cp.spawn(command, args, {
stdio: 'inherit'
});
proc.on('error', function (err) {
proc.removeAllListeners();
done(err);
});
proc.on('exit', function (status) {
proc.removeAllListeners();
done(status ? new Error(command + ' exited with status ' + status) : void 0);
});
}, function (err) {
if (err) {
console.log(chalk.red('\n\n⚑⚑⚑ Error! ⚑⚑⚑'));
console.error(err.message);
process.exit(1);
} else {
console.log(chalk.green('\n\n✔ looks good\n\n'));
process.exit(0);
}
});
} else {
console.log('Arguments resulted in no tests to run.');
console.log('Try combining test types with environments');
}

View File

@ -2,7 +2,7 @@ var async = require('async');
var fs = require('fs');
var S = require('string');
var restSpecDir = './src/rest-api-spec/api/';
var restSpecDir = './src/elasticsearch/rest-api-spec/api/';
function fileExists(path, done) {
fs.stat(path, function (err, stats) {

1
src/elasticsearch Submodule

Submodule src/elasticsearch added at edb3e5f0f4

View File

@ -497,7 +497,9 @@ api.cluster.prototype.state = ca({
* Perform a [count](http://elasticsearch.org/guide/reference/api/count/) request
*
* @param {Object} params - An object with parameters used to carry out this action
* @param {String} [params.ignoreIndices=none] - When performed on multiple indices, allows to ignore `missing` ones
* @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed)
* @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
* @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both.
* @param {Number} params.minScore - Include only documents with a specific `_score` value in the result
* @param {String} params.preference - Specify the node or shard the operation should be performed on (default: random)
* @param {String} params.routing - Specific routing value
@ -507,14 +509,22 @@ api.cluster.prototype.state = ca({
*/
api.count = ca({
params: {
ignoreIndices: {
ignoreUnavailable: {
type: 'boolean',
name: 'ignore_unavailable'
},
allowNoIndices: {
type: 'boolean',
name: 'allow_no_indices'
},
expandWildcards: {
type: 'enum',
'default': 'none',
'default': 'open',
options: [
'none',
'missing'
'open',
'closed'
],
name: 'ignore_indices'
name: 'expand_wildcards'
},
minScore: {
type: 'number',
@ -641,7 +651,9 @@ api['delete'] = ca({
* @param {String} params.consistency - Specific write consistency setting for the operation
* @param {String} [params.defaultOperator=OR] - The default operator for query string query (AND or OR)
* @param {String} params.df - The field to use as default where no field prefix is given in the query string
* @param {String} [params.ignoreIndices=none] - When performed on multiple indices, allows to ignore `missing` ones
* @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed)
* @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
* @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both.
* @param {String} [params.replication=sync] - Specific replication type
* @param {String} params.q - Query in the Lucene query string syntax
* @param {String} params.routing - Specific routing value
@ -675,14 +687,22 @@ api.deleteByQuery = ca({
df: {
type: 'string'
},
ignoreIndices: {
ignoreUnavailable: {
type: 'boolean',
name: 'ignore_unavailable'
},
allowNoIndices: {
type: 'boolean',
name: 'allow_no_indices'
},
expandWildcards: {
type: 'enum',
'default': 'none',
'default': 'open',
options: [
'none',
'missing'
'open',
'closed'
],
name: 'ignore_indices'
name: 'expand_wildcards'
},
replication: {
type: 'enum',
@ -1197,7 +1217,9 @@ api.indices.prototype.analyze = ca({
* @param {Boolean} params.filterKeys - A comma-separated list of keys to clear when using the `filter_cache` parameter (default: all)
* @param {Boolean} params.id - Clear ID caches for parent/child
* @param {Boolean} params.idCache - Clear ID caches for parent/child
* @param {String} [params.ignoreIndices=none] - When performed on multiple indices, allows to ignore `missing` ones
* @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed)
* @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
* @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both.
* @param {String, String[], Boolean} params.index - A comma-separated list of index name to limit the operation
* @param {Boolean} params.recycler - Clear the recycler cache
*/
@ -1231,14 +1253,22 @@ api.indices.prototype.clearCache = ca({
type: 'boolean',
name: 'id_cache'
},
ignoreIndices: {
ignoreUnavailable: {
type: 'boolean',
name: 'ignore_unavailable'
},
allowNoIndices: {
type: 'boolean',
name: 'allow_no_indices'
},
expandWildcards: {
type: 'enum',
'default': 'none',
'default': 'open',
options: [
'none',
'missing'
'open',
'closed'
],
name: 'ignore_indices'
name: 'expand_wildcards'
},
index: {
type: 'list'
@ -1529,20 +1559,33 @@ api.indices.prototype.exists = ca({
* Perform a [indices.existsAlias](http://www.elasticsearch.org/guide/reference/api/admin-indices-aliases/) request
*
* @param {Object} params - An object with parameters used to carry out this action
* @param {String} [params.ignoreIndices=none] - When performed on multiple indices, allows to ignore `missing` ones
* @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed)
* @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
* @param {String} [params.expandWildcards=open,closed] - Whether to expand wildcard expression to concrete indices that are open, closed or both.
* @param {String, String[], Boolean} params.index - A comma-separated list of index names to filter aliases
* @param {String, String[], Boolean} params.name - A comma-separated list of alias names to return
*/
api.indices.prototype.existsAlias = ca({
params: {
ignoreIndices: {
ignoreUnavailable: {
type: 'boolean',
name: 'ignore_unavailable'
},
allowNoIndices: {
type: 'boolean',
name: 'allow_no_indices'
},
expandWildcards: {
type: 'enum',
'default': 'none',
options: [
'none',
'missing'
'default': [
'open',
'closed'
],
name: 'ignore_indices'
options: [
'open',
'closed'
],
name: 'expand_wildcards'
}
},
urls: [
@ -1564,6 +1607,14 @@ api.indices.prototype.existsAlias = ca({
type: 'list'
}
}
},
{
fmt: '/<%=index%>/_alias',
req: {
index: {
type: 'list'
}
}
}
],
castExists: true,
@ -1574,20 +1625,30 @@ api.indices.prototype.existsAlias = ca({
* Perform a [indices.existsType](http://www.elasticsearch.org/guide/reference/api/admin-indices-types-exists/) request
*
* @param {Object} params - An object with parameters used to carry out this action
* @param {String} [params.ignoreIndices=none] - When performed on multiple indices, allows to ignore `missing` ones
* @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed)
* @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
* @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both.
* @param {String, String[], Boolean} params.index - A comma-separated list of index names; use `_all` to check the types across all indices
* @param {String, String[], Boolean} params.type - A comma-separated list of document types to check
*/
api.indices.prototype.existsType = ca({
params: {
ignoreIndices: {
ignoreUnavailable: {
type: 'boolean',
name: 'ignore_unavailable'
},
allowNoIndices: {
type: 'boolean',
name: 'allow_no_indices'
},
expandWildcards: {
type: 'enum',
'default': 'none',
'default': 'open',
options: [
'none',
'missing'
'open',
'closed'
],
name: 'ignore_indices'
name: 'expand_wildcards'
}
},
url: {
@ -1612,7 +1673,9 @@ api.indices.prototype.existsType = ca({
* @param {Object} params - An object with parameters used to carry out this action
* @param {Boolean} params.force - TODO: ?
* @param {Boolean} params.full - TODO: ?
* @param {String} [params.ignoreIndices=none] - When performed on multiple indices, allows to ignore `missing` ones
* @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed)
* @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
* @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both.
* @param {Boolean} params.refresh - Refresh the index after performing the operation
* @param {String, String[], Boolean} params.index - A comma-separated list of index names; use `_all` or empty string for all indices
*/
@ -1624,14 +1687,22 @@ api.indices.prototype.flush = ca({
full: {
type: 'boolean'
},
ignoreIndices: {
ignoreUnavailable: {
type: 'boolean',
name: 'ignore_unavailable'
},
allowNoIndices: {
type: 'boolean',
name: 'allow_no_indices'
},
expandWildcards: {
type: 'enum',
'default': 'none',
'default': 'open',
options: [
'none',
'missing'
'open',
'closed'
],
name: 'ignore_indices'
name: 'expand_wildcards'
},
refresh: {
type: 'boolean'
@ -1657,20 +1728,30 @@ api.indices.prototype.flush = ca({
* Perform a [indices.getAlias](http://www.elasticsearch.org/guide/reference/api/admin-indices-aliases/) request
*
* @param {Object} params - An object with parameters used to carry out this action
* @param {String} [params.ignoreIndices=none] - When performed on multiple indices, allows to ignore `missing` ones
* @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed)
* @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
* @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both.
* @param {String, String[], Boolean} params.index - A comma-separated list of index names to filter aliases
* @param {String, String[], Boolean} params.name - A comma-separated list of alias names to return
*/
api.indices.prototype.getAlias = ca({
params: {
ignoreIndices: {
ignoreUnavailable: {
type: 'boolean',
name: 'ignore_unavailable'
},
allowNoIndices: {
type: 'boolean',
name: 'allow_no_indices'
},
expandWildcards: {
type: 'enum',
'default': 'none',
'default': 'open',
options: [
'none',
'missing'
'open',
'closed'
],
name: 'ignore_indices'
name: 'expand_wildcards'
}
},
urls: [
@ -1692,34 +1773,14 @@ api.indices.prototype.getAlias = ca({
type: 'list'
}
}
}
]
});
/**
* Perform a [indices.getAliases](http://www.elasticsearch.org/guide/reference/api/admin-indices-aliases/) request
*
* @param {Object} params - An object with parameters used to carry out this action
* @param {Date, Number} params.timeout - Explicit operation timeout
* @param {String, String[], Boolean} params.index - A comma-separated list of index names to filter aliases
*/
api.indices.prototype.getAliases = ca({
params: {
timeout: {
type: 'time'
}
},
urls: [
},
{
fmt: '/<%=index%>/_aliases',
fmt: '/<%=index%>/_alias',
req: {
index: {
type: 'list'
}
}
},
{
fmt: '/_aliases'
}
]
});
@ -1936,7 +1997,9 @@ api.indices.prototype.open = ca({
*
* @param {Object} params - An object with parameters used to carry out this action
* @param {Boolean} params.flush - Specify whether the index should be flushed after performing the operation (default: true)
* @param {String} [params.ignoreIndices=none] - When performed on multiple indices, allows to ignore `missing` ones
* @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed)
* @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
* @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both.
* @param {Number} params.maxNumSegments - The number of segments the index should be merged into (default: dynamic)
* @param {Boolean} params.onlyExpungeDeletes - Specify whether the operation should only expunge deleted documents
* @param {Anything} params.operationThreading - TODO: ?
@ -1949,14 +2012,22 @@ api.indices.prototype.optimize = ca({
flush: {
type: 'boolean'
},
ignoreIndices: {
ignoreUnavailable: {
type: 'boolean',
name: 'ignore_unavailable'
},
allowNoIndices: {
type: 'boolean',
name: 'allow_no_indices'
},
expandWildcards: {
type: 'enum',
'default': 'none',
'default': 'open',
options: [
'none',
'missing'
'open',
'closed'
],
name: 'ignore_indices'
name: 'expand_wildcards'
},
maxNumSegments: {
type: 'number',
@ -2200,20 +2271,30 @@ api.indices.prototype.putWarmer = ca({
* Perform a [indices.refresh](http://www.elasticsearch.org/guide/reference/api/admin-indices-refresh/) request
*
* @param {Object} params - An object with parameters used to carry out this action
* @param {String} [params.ignoreIndices=none] - When performed on multiple indices, allows to ignore `missing` ones
* @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed)
* @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
* @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both.
* @param {Anything} params.operationThreading - TODO: ?
* @param {String, String[], Boolean} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
*/
api.indices.prototype.refresh = ca({
params: {
ignoreIndices: {
ignoreUnavailable: {
type: 'boolean',
name: 'ignore_unavailable'
},
allowNoIndices: {
type: 'boolean',
name: 'allow_no_indices'
},
expandWildcards: {
type: 'enum',
'default': 'none',
'default': 'open',
options: [
'none',
'missing'
'open',
'closed'
],
name: 'ignore_indices'
name: 'expand_wildcards'
},
operationThreading: {
name: 'operation_threading'
@ -2239,20 +2320,30 @@ api.indices.prototype.refresh = ca({
* Perform a [indices.segments](http://elasticsearch.org/guide/reference/api/admin-indices-segments/) request
*
* @param {Object} params - An object with parameters used to carry out this action
* @param {String} [params.ignoreIndices=none] - When performed on multiple indices, allows to ignore `missing` ones
* @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed)
* @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
* @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both.
* @param {Anything} params.operationThreading - TODO: ?
* @param {String, String[], Boolean} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
*/
api.indices.prototype.segments = ca({
params: {
ignoreIndices: {
ignoreUnavailable: {
type: 'boolean',
name: 'ignore_unavailable'
},
allowNoIndices: {
type: 'boolean',
name: 'allow_no_indices'
},
expandWildcards: {
type: 'enum',
'default': 'none',
'default': 'open',
options: [
'none',
'missing'
'open',
'closed'
],
name: 'ignore_indices'
name: 'expand_wildcards'
},
operationThreading: {
name: 'operation_threading'
@ -2277,19 +2368,29 @@ api.indices.prototype.segments = ca({
* Perform a [indices.snapshotIndex](http://www.elasticsearch.org/guide/reference/api/admin-indices-gateway-snapshot/) request
*
* @param {Object} params - An object with parameters used to carry out this action
* @param {String} [params.ignoreIndices=none] - When performed on multiple indices, allows to ignore `missing` ones
* @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed)
* @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
* @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both.
* @param {String, String[], Boolean} params.index - A comma-separated list of index names; use `_all` or empty string for all indices
*/
api.indices.prototype.snapshotIndex = ca({
params: {
ignoreIndices: {
ignoreUnavailable: {
type: 'boolean',
name: 'ignore_unavailable'
},
allowNoIndices: {
type: 'boolean',
name: 'allow_no_indices'
},
expandWildcards: {
type: 'enum',
'default': 'none',
'default': 'open',
options: [
'none',
'missing'
'open',
'closed'
],
name: 'ignore_indices'
name: 'expand_wildcards'
}
},
urls: [
@ -2325,7 +2426,9 @@ api.indices.prototype.snapshotIndex = ca({
* @param {Boolean} params.get - Return information about get operations
* @param {Boolean} params.groups - A comma-separated list of search groups for `search` statistics
* @param {Boolean} params.idCache - Return information about ID cache
* @param {String} [params.ignoreIndices=none] - When performed on multiple indices, allows to ignore `missing` ones
* @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed)
* @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
* @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both.
* @param {Boolean} params.indexing - Return information about indexing operations
* @param {Boolean} params.merge - Return information about merge operations
* @param {Boolean} params.refresh - Return information about refresh operations
@ -2382,14 +2485,22 @@ api.indices.prototype.stats = ca({
type: 'boolean',
name: 'id_cache'
},
ignoreIndices: {
ignoreUnavailable: {
type: 'boolean',
name: 'ignore_unavailable'
},
allowNoIndices: {
type: 'boolean',
name: 'allow_no_indices'
},
expandWildcards: {
type: 'enum',
'default': 'none',
'default': 'open',
options: [
'none',
'missing'
'open',
'closed'
],
name: 'ignore_indices'
name: 'expand_wildcards'
},
indexing: {
type: 'boolean'
@ -2429,7 +2540,9 @@ api.indices.prototype.stats = ca({
* Perform a [indices.status](http://elasticsearch.org/guide/reference/api/admin-indices-status/) request
*
* @param {Object} params - An object with parameters used to carry out this action
* @param {String} [params.ignoreIndices=none] - When performed on multiple indices, allows to ignore `missing` ones
* @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed)
* @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
* @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both.
* @param {Anything} params.operationThreading - TODO: ?
* @param {Boolean} params.recovery - Return information about shard recovery
* @param {Boolean} params.snapshot - TODO: ?
@ -2437,14 +2550,22 @@ api.indices.prototype.stats = ca({
*/
api.indices.prototype.status = ca({
params: {
ignoreIndices: {
ignoreUnavailable: {
type: 'boolean',
name: 'ignore_unavailable'
},
allowNoIndices: {
type: 'boolean',
name: 'allow_no_indices'
},
expandWildcards: {
type: 'enum',
'default': 'none',
'default': 'open',
options: [
'none',
'missing'
'open',
'closed'
],
name: 'ignore_indices'
name: 'expand_wildcards'
},
operationThreading: {
name: 'operation_threading'
@ -2500,7 +2621,9 @@ api.indices.prototype.updateAliases = ca({
*
* @param {Object} params - An object with parameters used to carry out this action
* @param {Boolean} params.explain - Return detailed information about the error
* @param {String} [params.ignoreIndices=none] - When performed on multiple indices, allows to ignore `missing` ones
* @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed)
* @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
* @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both.
* @param {Anything} params.operationThreading - TODO: ?
* @param {String} params.source - The URL-encoded query definition (instead of using the request body)
* @param {String} params.q - Query in the Lucene query string syntax
@ -2512,14 +2635,22 @@ api.indices.prototype.validateQuery = ca({
explain: {
type: 'boolean'
},
ignoreIndices: {
ignoreUnavailable: {
type: 'boolean',
name: 'ignore_unavailable'
},
allowNoIndices: {
type: 'boolean',
name: 'allow_no_indices'
},
expandWildcards: {
type: 'enum',
'default': 'none',
'default': 'open',
options: [
'none',
'missing'
'open',
'closed'
],
name: 'ignore_indices'
name: 'expand_wildcards'
},
operationThreading: {
name: 'operation_threading'
@ -2884,7 +3015,9 @@ api.scroll = ca({
* @param {Boolean} params.explain - Specify whether to return detailed information about score computation as part of a hit
* @param {String, String[], Boolean} params.fields - A comma-separated list of fields to return as part of a hit
* @param {Number} params.from - Starting offset (default: 0)
* @param {String} [params.ignoreIndices=none] - When performed on multiple indices, allows to ignore `missing` ones
* @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed)
* @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
* @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both.
* @param {String, String[], Boolean} params.indicesBoost - Comma-separated list of index boosts
* @param {Boolean} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
* @param {Boolean} params.lowercaseExpandedTerms - Specify whether query terms should be lowercased
@ -2939,14 +3072,22 @@ api.search = ca({
from: {
type: 'number'
},
ignoreIndices: {
ignoreUnavailable: {
type: 'boolean',
name: 'ignore_unavailable'
},
allowNoIndices: {
type: 'boolean',
name: 'allow_no_indices'
},
expandWildcards: {
type: 'enum',
'default': 'none',
'default': 'open',
options: [
'none',
'missing'
'open',
'closed'
],
name: 'ignore_indices'
name: 'expand_wildcards'
},
indicesBoost: {
type: 'list',
@ -3067,7 +3208,9 @@ api.search = ca({
* Perform a [suggest](http://elasticsearch.org/guide/reference/api/search/suggest/) request
*
* @param {Object} params - An object with parameters used to carry out this action
* @param {String} [params.ignoreIndices=none] - When performed on multiple indices, allows to ignore `missing` ones
* @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed)
* @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
* @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both.
* @param {String} params.preference - Specify the node or shard the operation should be performed on (default: random)
* @param {String} params.routing - Specific routing value
* @param {String} params.source - The URL-encoded request definition (instead of using request body)
@ -3075,14 +3218,22 @@ api.search = ca({
*/
api.suggest = ca({
params: {
ignoreIndices: {
ignoreUnavailable: {
type: 'boolean',
name: 'ignore_unavailable'
},
allowNoIndices: {
type: 'boolean',
name: 'allow_no_indices'
},
expandWildcards: {
type: 'enum',
'default': 'none',
'default': 'open',
options: [
'none',
'missing'
'open',
'closed'
],
name: 'ignore_indices'
name: 'expand_wildcards'
},
preference: {
type: 'string'