[console] 6.0 API and ace refactor (#18930) (#19066)

* capturing refactoring work in progress

* cleanup

* removing 5.0 API

* updating autocomplete aggregations to supported ones

* adding documentation links to generated specs

* progress on ace upgrade

* further progress

* cleaning up

* adding new minified source for worker

* fixing bug with merging API definitions

* addressing PR feedback

* using raw loader to load worker file

* addressing PR feedback

* fixing bad characters in comments

* removing inadvertent change

* fixing scope links

* fixing a couple of scope links

* adding in exists to query dsl

* adding slop param for match_phrase query

* adding autocomplete support for search params

* Revert "using raw loader to load worker file"

This reverts commit 16d33c189c.

* adding rescore API support for autocomplete

* adding index boost API support for autocomplete

* adding collapse to autocomplete

* adding highlight property support to autocomplete

* fixing issue with highlight

* adding support for common terms query

* adding inner hits support for autocomplete

* adding support for newer match options to match and multi_match

* better solution for worker
This commit is contained in:
Bill McConaghy 2018-05-15 09:18:11 -04:00 committed by GitHub
parent daaba27f21
commit 6fed438e90
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
187 changed files with 4862 additions and 26354 deletions

View file

@ -1,45 +1,51 @@
const _ = require("lodash");
import _ from 'lodash';
'use strict';
/**
*
* @param name
*/
function Api(name) {
this.globalRules = {};
this.endpoints = {};
this.name = name;
}
(function (cls) {
cls.addGlobalAutocompleteRules = function (parentNode, rules) {
class Api {
constructor(name) {
this.globalRules = {};
this.endpoints = {};
this.name = name;
}
addGlobalAutocompleteRules = function (parentNode, rules) {
this.globalRules[parentNode] = rules;
};
cls.addEndpointDescription = function (endpoint, description) {
}
addEndpointDescription(endpoint, description = {}) {
let copiedDescription = {};
if (this.endpoints[endpoint]) {
throw new Error("endpoint [" + endpoint + "] is already registered");
copiedDescription = { ...this.endpoints[endpoint] };
}
let urlParamsDef;
_.each(description.patterns || [], function (p) {
if (p.indexOf('{indices}') >= 0) {
urlParamsDef = urlParamsDef || {};
urlParamsDef.ignore_unavailable = '__flag__';
urlParamsDef.allow_no_indices = '__flag__';
urlParamsDef.expand_wildcards = ['open', 'closed'];
}
});
if (urlParamsDef) {
description.url_params = _.extend(description.url_params || {}, copiedDescription.url_params);
_.defaults(description.url_params, urlParamsDef);
}
var copiedDescription = {};
_.extend(copiedDescription, description || {});
_.extend(copiedDescription, description);
_.defaults(copiedDescription, {
id: endpoint,
patterns: [endpoint],
methods: ['GET']
});
this.endpoints[endpoint] = copiedDescription;
};
}
cls.asJson = function () {
asJson() {
return {
"name": this.name,
"globals": this.globalRules,
"endpoints": this.endpoints
}
};
'name': this.name,
'globals': this.globalRules,
'endpoints': this.endpoints
};
}
}(Api.prototype));
}
export default Api;

View file

@ -1,56 +0,0 @@
let _ = require("lodash");
let Api = require('./api');
import { getSpec } from './spec'
let parts = [
require('./es_5_0/aliases'),
require('./es_5_0/aggregations'),
require('./es_5_0/document'),
require('./es_5_0/filter'),
require('./es_5_0/nodes'),
require('./es_5_0/globals'),
require('./es_5_0/ingest'),
require('./es_5_0/mappings'),
require('./es_5_0/percolator'),
require('./es_5_0/query'),
require('./es_5_0/reindex'),
require('./es_5_0/search'),
];
function ES_5_0() {
Api.call(this, "es_5_0");
_.each(parts, function (apiSection) {
apiSection(this);
}, this);
const spec = getSpec()
Object.keys(spec).forEach(endpoint => {
this.addEndpointDescription(endpoint, spec[endpoint])
})
}
ES_5_0.prototype = _.create(Api.prototype, { 'constructor': ES_5_0 });
(function (cls) {
cls.addEndpointDescription = function (endpoint, description) {
if (description) {
var url_params_def = {};
_.each(description.patterns || [], function (p) {
if (p.indexOf("{indices}") >= 0) {
url_params_def["ignore_unavailable"] = "__flag__";
url_params_def["allow_no_indices"] = "__flag__";
url_params_def["expand_wildcards"] = ["open", "closed"];
}
});
if (url_params_def) {
description.url_params = description.url_params || {};
_.defaults(description.url_params, url_params_def);
}
}
Object.getPrototypeOf(cls).addEndpointDescription.call(this, endpoint, description);
};
})(ES_5_0.prototype);
const instance = new ES_5_0();
export default instance;

View file

@ -1,478 +0,0 @@
var simple_metric = {
__template: { field: "" },
field: "{field}",
missing: 0,
script: {
// populated by a global rule
}
}, field_metric = {
__template: { field: "" },
field: "{field}"
}, gap_policy = {
__one_of: ["skip", "insert_zeros"]
}, simple_pipeline = {
__template: {
buckets_path: ""
},
buckets_path: "",
format: "",
gap_policy: gap_policy
};
var rules = {
"*": {
"aggs": {
__template: {
"NAME": {
"AGG_TYPE": {}
}
}
},
"min": simple_metric,
"max": simple_metric,
"avg": simple_metric,
"sum": simple_metric,
"stats": simple_metric,
"extended_stats": simple_metric,
"value_count": {
__template: {
"field": ""
},
"field": "{field}",
"script": {
// populated by a global rule
}
},
"global": {},
"filter": {},
"filters": {
__template: {
"filters": {
"NAME": {}
}
},
"filters": {
"*": { __scope_link: "GLOBAL.filter" }
},
"other_bucket": { __one_of: [true, false] },
"other_bucket_key": ""
},
"missing": field_metric,
"nested": {
__template: {
"path": ""
},
"path": ""
},
"reverse_nested": {
__template: {
"path": ""
},
"path": ""
},
"terms": {
__template: {
"field": "",
"size": 10
},
"field": "{field}",
"size": 10,
"shard_size": 10,
"order": {
__template: {
"_term": "asc"
},
"_term": { __one_of: ["asc", "desc"] },
"_count": { __one_of: ["asc", "desc"] },
"*": { __one_of: ["asc", "desc"] }
},
"min_doc_count": 10,
"script": {
// populated by a global rule
},
"include": ".*",
"exclude": ".*",
"execution_hint": { __one_of: ["map", "global_ordinals", "global_ordinals_hash", "global_ordinals_low_cardinality"] },
"show_term_doc_count_error": { __one_of: [true, false] },
"collect_mode": { __one_of: ["depth_first", "breadth_first"] },
"missing": ""
},
"significant_terms": {
__template: {
"field": ""
},
"field": "{field}",
"size": 10,
"shard_size": 10,
"shard_min_doc_count": 10,
"min_doc_count": 10,
"include": { __one_of: ["*", { pattern: "", flags: "" }] },
"exclude": { __one_of: ["*", { pattern: "", flags: "" }] },
"execution_hint": { __one_of: ["map", "global_ordinals", "global_ordinals_hash"] },
"background_filter": {
__scope_link: "GLOBAL.filter"
},
"mutual_information": {
"include_negatives": { __one_of: [true, false] }
},
"chi_square": {
"include_negatives": { __one_of: [true, false] },
"background_is_superset": { __one_of: [true, false] }
},
"percentage": {},
"gnd": {
"background_is_superset": { __one_of: [true, false] }
},
"script_heuristic": {
__template: {
"script": "_subset_freq/(_superset_freq - _subset_freq + 1)"
},
"script": {
// populated by a global rule
}
}
},
"range": {
__template: {
"field": "",
"ranges": [
{ "from": 50, "to": 100 },
]
},
"field": "{field}",
"ranges": [
{ "to": 50, "from": 100, "key": "" }
],
"keyed": { __one_of: [true, false] },
"script": {
// populated by a global rule
}
},
"date_range": {
__template: {
"field": "",
"ranges": [
{ "from": "now-10d/d", "to": "now" },
]
},
"field": "{field}",
"format": "MM-yyy",
"ranges": [
{ "to": "", "from": "", "key": "" }
],
"keyed": { __one_of: [true, false] },
"script": {
// populated by a global rule
}
},
"ip_range": {
__template: {
"field": "",
"ranges": [
{ "from": "10.0.0.5", "to": "10.0.0.10" },
]
},
"field": "{field}",
"format": "MM-yyy",
"ranges": [
{ "to": "", "from": "", "key": "", "mask": "10.0.0.127/25" }
],
"keyed": { __one_of: [true, false] },
"script": {
// populated by a global rule
}
},
"histogram": {
__template: {
"field": "price",
"interval": 50
},
"field": "{field}",
"interval": 50,
"extended_bounds": {
"__template": {
"min": 0,
"max": 50
},
"min": 0,
"max": 50
},
"min_doc_count": 0,
"order": {
__template: {
"_key": "asc"
},
"_key": { __one_of: ["asc", "desc"] },
"_count": { __one_of: ["asc", "desc"] },
"*": { __one_of: ["asc", "desc"] }
},
"keyed": { __one_of: [true, false] },
"missing": 0
},
"date_histogram": {
__template: {
"field": "date",
"interval": "month"
},
"field": "{field}",
"interval": { __one_of: ["year", "quarter", "week", "day", "hour", "minute", "second"] },
"min_doc_count": 0,
"extended_bounds": {
"__template": {
"min": "now/d",
"max": "now/d"
},
"min": "now/d",
"max": "now/d"
},
"order": {
__template: {
"_key": "asc"
},
"_key": { __one_of: ["asc", "desc"] },
"_count": { __one_of: ["asc", "desc"] },
"*": { __one_of: ["asc", "desc"] }
},
"keyed": { __one_of: [true, false] },
"pre_zone": "-01:00",
"post_zone": "-01:00",
"pre_zone_adjust_large_interval": { __one_of: [true, false] },
"factor": 1000,
"pre_offset": "1d",
"post_offset": "1d",
"format": "yyyy-MM-dd",
"time_zone": "00:00",
"missing": ""
},
"geo_distance": {
__template: {
"field": "location",
"origin": { "lat": 52.3760, "lon": 4.894 },
"ranges": [
{ "from": 100, "to": 300 },
]
},
"field": "{field}",
"origin": { "lat": 0.0, "lon": 0.0 },
"unit": { __one_of: ["mi", "km", "in", "yd", "m", "cm", "mm"] },
"ranges": [
{ "from": 50, "to": 100 }
],
"distance_type": { __one_of: ["arc", "sloppy_arc", "plane"] }
},
"geohash_grid": {
__template: {
"field": "",
"precision": 3
},
"field": "{field}",
"precision": { __one_of: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] },
"size": 10,
"shard_size": 10
},
"composite": {
__template: {
"sources": [
{
"NAME": {
"AGG_TYPE": {}
}
}
]
},
"sources": [
{
__scope_link: ".",
__template: {
"NAME": {
"AGG_TYPE": {}
}
}
}
],
"size": 10,
"after": {}
},
"percentiles": {
__template: {
"field": "",
"percents": [1.0, 5.0, 25.0, 50.0, 75.0, 95.0, 99.0]
},
"field": "{field}",
"percents": {
__template: [1.0, 5.0, 25.0, 50.0, 75.0, 95.0, 99.0],
// mark type as list
__any_of: []
},
"script": {
// populated by a global rule
},
"compression": 100,
"method": { __one_of: ["hdr", "tdigest"] },
missing: 0
},
"cardinality": {
__template: {
"field": ""
},
"precision_threshold": 100,
"rehash": true,
"script": {
// populated by a global rule
},
missing: ""
},
"scripted_metric": {
__template: {
"init_script": "",
"map_script": "",
"combine_script": "",
"reduce_script": ""
},
"init_script": {
__scope_link: "GLOBAL.script"
},
"map_script": {
__scope_link: "GLOBAL.script"
},
"combine_script": {
__scope_link: "GLOBAL.script"
},
"reduce_script": {
__scope_link: "GLOBAL.script"
},
"lang": "groovy",
"params": {},
"reduce_params": {}
},
"geo_bounds": {
__template: {
field: ""
},
field: "{field}",
wrap_longitude: { __one_of: [true, false] }
},
"top_hits": {
__template: {
size: 10
},
from: 0,
size: 10,
sort: {
__template: [],
__scope_link: "_search.sort"
},
highlight: {},
explain: { __one_of: [true, false] },
_source: {
__template: "",
__scope_link: "_search._source"
},
script_fields: {
__scope_link: "_search.script_fields"
},
docvalue_fields: ["{field}"],
version: { __one_of: [true, false] }
},
"percentile_ranks": {
__template: {
field: "",
values: [10, 15]
},
field: "{field}",
values: [],
"script": {
// populated by a global rule
},
"compression": 100,
"method": { __one_of: ["hdr", "tdigest"] },
missing: 0
},
"sampler": {
__template: {},
"field": "{field}",
"script": {
// populated by a global rule
},
"shard_size": 100,
"max_docs_per_value": 3,
"execution_hint": { __one_of: ["map", "global_ordinals", "bytes_hash"] }
},
"children": {
__template: {
"type": "",
},
"type": ""
},
"derivative": simple_pipeline,
"avg_bucket": simple_pipeline,
"max_bucket": simple_pipeline,
"min_bucket": simple_pipeline,
"sum_bucket": simple_pipeline,
"moving_avg": {
__template: {
buckets_path: ""
},
buckets_path: "",
format: "",
gap_policy: gap_policy,
"window": 5,
model: { __one_of: ["simple", "linear", "ewma", "holt", "holt_winters"] },
settings: {
type: { __one_of: ["add", "mult"] },
alpha: 0.5,
beta: 0.5,
gamma: 0.5,
period: 7
}
},
"cumulative_sum": {
__template: {
buckets_path: ""
},
buckets_path: "",
format: ""
},
"serial_diff": {
__template: {
buckets_path: "",
lag: 7
},
lag: 7,
gap_policy: gap_policy,
buckets_path: "",
format: ""
},
"bucket_script": {
__template: {
buckets_path: {},
script: ""
},
buckets_path: {},
format: "",
gap_policy: gap_policy,
script: ""
},
"bucket_selector": {
__template: {
buckets_path: {},
script: ""
},
buckets_path: {},
gap_policy: gap_policy,
script: ""
},
"matrix_stats": {
__template: {
fields: []
},
fields: ["{field}"]
}
}
};
export default function (api) {
api.addGlobalAutocompleteRules('aggregations', rules);
api.addGlobalAutocompleteRules('aggs', rules);
}

View file

@ -1,26 +0,0 @@
export default function (api) {
api.addEndpointDescription('_get_aliases', {
methods: ['GET'],
patterns: [
"_aliases",
]
});
var aliasRules = {
filter: {},
routing: '1',
search_routing: '1,2',
index_routing: '1'
};
api.addEndpointDescription('_delete_alias', {
methods: ["DELETE"],
patterns: [
"{indices}/_alias/{name}"
]
});
api.addGlobalAutocompleteRules('aliases', {
'*': aliasRules
});
}

View file

@ -1,141 +0,0 @@
export default function (api) {
api.addEndpointDescription('_update', {
methods: ['POST'],
patterns: [
"{index}/{type}/{id}/_update"
],
url_params: {
"version": 1,
"version_type": ["force", "internal"],
"routing": "",
"parent": "",
"timestamp": "",
"consistency": ["qurom", "one", "all"],
"refresh": "__flag__",
"timeout": "1m",
"retry_on_conflict": 3,
"fields": ""
},
data_autocomplete_rules: {
"script": {
// populated by a global rule
},
"doc": {},
"upsert": {},
"scripted_upsert": { __one_of: [true, false] }
}
});
api.addEndpointDescription('_put_script', {
methods: ['POST', 'PUT'],
patterns: [
"_scripts/{lang}/{id}",
"_scripts/{lang}/{id}/_create"
],
url_components: {
"lang": [
"groovy",
"expressions"
]
},
data_autocomplete_rules: {
"script": ""
}
});
api.addEndpointDescription('_termvectors', {
methods: ['GET', 'POST'],
patterns: [
"{index}/{type}/_termvectors"
],
priority: 10, // collision with get doc
url_params: {
"fields": "",
"offsets": "__flag__",
"payloads": "__flag__",
"positions": "__flag__",
"term_statistics": "__flag__",
"field_statistics": "__flag__",
"routing": "",
"version": 1,
"version_type": ["external", "external_gt", "external_gte", "force", "internal"],
"parent": "",
"preference": ""
},
data_autocomplete_rules: {
fields: [
"{field}"
],
offsets: { __one_of: [false, true] },
payloads: { __one_of: [false, true] },
positions: { __one_of: [false, true] },
term_statistics: { __one_of: [true, false] },
field_statistics: { __one_of: [false, true] },
per_field_analyzer: {
__template: { "FIELD": "" },
"{field}": ""
},
routing: "",
version: 1,
version_type: ["external", "external_gt", "external_gte", "force", "internal"],
doc: {},
filter: { // TODO: Exclude from global filter rules
"max_num_terms": 1,
"min_term_freq": 1,
"max_term_freq": 1,
"min_doc_freq": 1,
"max_doc_freq": 1,
"min_word_length": 1,
"max_word_length": 1
}
}
});
api.addEndpointDescription('_termvectors_id', {
methods: ['GET', 'POST'],
patterns: [
"{index}/{type}/{id}/_termvectors"
],
url_params: {
"fields": "",
"offsets": "__flag__",
"payloads": "__flag__",
"positions": "__flag__",
"term_statistics": "__flag__",
"field_statistics": "__flag__",
"routing": "",
"version": 1,
"version_type": ["external", "external_gt", "external_gte", "force", "internal"],
"parent": "",
"preference": "",
"dfs": "__flag__"
},
data_autocomplete_rules: {
fields: [
"{field}"
],
offsets: { __one_of: [false, true] },
payloads: { __one_of: [false, true] },
positions: { __one_of: [false, true] },
term_statistics: { __one_of: [true, false] },
field_statistics: { __one_of: [false, true] },
dfs: { __one_of: [true, false] },
per_field_analyzer: {
__template: { "FIELD": "" },
"{field}": ""
},
routing: "",
version: 1,
version_type: ["external", "external_gt", "external_gte", "force", "internal"],
filter: { // TODO: Exclude from global filter rules
"max_num_terms": 1,
"min_term_freq": 1,
"max_term_freq": 1,
"min_doc_freq": 1,
"max_doc_freq": 1,
"min_word_length": 1,
"max_word_length": 1
}
}
});
}

View file

@ -1,24 +0,0 @@
export default function (api) {
api.addGlobalAutocompleteRules('highlight', {
pre_tags: {},
post_tags: {},
tags_schema: {},
fields: {
'{field}': {
fragment_size: 20,
number_of_fragments: 3
}
}
});
api.addGlobalAutocompleteRules('script', {
__template: {
inline: "SCRIPT"
},
inline: "SCRIPT",
file: "FILE_SCRIPT_NAME",
id: "SCRIPT_ID",
lang: "",
params: {}
});
}

View file

@ -1,78 +0,0 @@
export default function (api) {
api.addEndpointDescription('_nodes/hot_threads', {
methods: ['GET'],
patterns: [
"_nodes/hot_threads",
"_nodes/{nodes}/hot_threads"
]
});
api.addEndpointDescription('_nodes/info', {
patterns: [
"_nodes",
"_nodes/{metrics}",
"_nodes/{nodes}",
"_nodes/{nodes}/{metrics}",
"_nodes/{nodes}/info/{metrics}"
],
url_components: {
"metrics": [
"settings",
"os",
"process",
"jvm",
"thread_pool",
"network",
"transport",
"http",
"plugins",
"ingest",
"_all"
]
}
});
api.addEndpointDescription('_nodes/stats', {
patterns: [
"_nodes/stats",
"_nodes/stats/{metrics}",
"_nodes/stats/{metrics}/{index_metric}",
"_nodes/{nodes}/stats",
"_nodes/{nodes}/stats/{metrics}",
"_nodes/{nodes}/stats/{metrics}/{index_metric}"
],
url_components: {
"metrics": [
"os",
"jvm",
"thread_pool",
"network",
"fs",
"transport",
"http",
"indices",
"process",
"breaker",
"ingest",
"_all"
],
"index_metric": [
"store",
"indexing",
"get",
"search",
"merge",
"flush",
"refresh",
"filter_cache",
"fielddata",
"docs",
"warmer",
"percolate",
"completion",
"segments",
"translog",
"query_cache",
"_all"
]
}
});
}

View file

@ -1,90 +0,0 @@
export default function (api) {
api.addEndpointDescription('_put_percolator', {
priority: 10, // to override doc
methods: ['PUT', 'POST'],
patterns: [
"{index}/.percolator/{id}"
],
url_params: {
"version": 1,
"version_type": ["external", "internal"],
"op_type": ["create"],
"routing": "",
"parent": "",
"timestamp": "",
"ttl": "5m",
"consistency": ["qurom", "one", "all"],
"refresh": "__flag__",
"timeout": "1m"
},
data_autocomplete_rules: {
query: {}
}
});
api.addEndpointDescription('_percolate', {
methods: ['GET', 'POST'],
priority: 10, // to override doc
patterns: [
"{indices}/{type}/_percolate"
],
url_params: {
preference: ["_primary", "_primary_first", "_local", "_only_node:xyz", "_prefer_node:xyz", "_shards:2,3"],
routing: "",
ignore_unavailable: ["true", "false"],
percolate_format: ["ids"]
},
data_autocomplete_rules: {
doc: {},
query: {},
filter: {},
size: 10,
track_scores: { __one_of: [true, false] },
sort: "_score",
aggs: {},
highlight: {}
}
});
api.addEndpointDescription('_percolate_id', {
methods: ['GET', 'POST'],
patterns: [
"{indices}/{type}/{id}/_percolate"
],
url_params: {
routing: "",
ignore_unavailable: ["true", "false"],
percolate_format: ["ids"],
percolate_index: "{index}",
percolate_type: "{type}",
percolate_routing: "",
percolate_preference: ["_primary", "_primary_first", "_local", "_only_node:xyz", "_prefer_node:xyz", "_shards:2,3"],
version: 1,
version_type: ["external", "internal"]
},
data_autocomplete_rules: {
query: {},
filter: {},
size: 10,
track_scores: { __one_of: [true, false] },
sort: "_score",
aggs: {},
highlight: {}
}
});
api.addEndpointDescription('_percolate_count', {
methods: ['GET', 'POST'],
patterns: [
"{indices}/{type}/_percolate/count"
],
url_params: {
preference: ["_primary", "_primary_first", "_local", "_only_node:xyz", "_prefer_node:xyz", "_shards:2,3"],
routing: "",
ignore_unavailable: ["true", "false"],
percolate_format: ["ids"]
},
data_autocomplete_rules: {
doc: {},
query: {},
filter: {}
}
});
}

View file

@ -1,254 +0,0 @@
export default function (api) {
api.addEndpointDescription('_search', {
methods: ['GET', 'POST'],
priority: 10, // collides with get doc by id
patterns: [
'{indices}/{types}/_search',
'{indices}/_search',
'_search'
],
url_params: {
q: '',
df: '',
analyzer: '',
default_operator: ['AND', 'OR'],
explain: '__flag__',
_source: '',
_source_includes: '',
_source_excludes: '',
stored_fields: [],
sort: '',
track_scores: '__flag__',
timeout: 1,
from: 0,
size: 10,
search_type: ['dfs_query_then_fetch', 'query_then_fetch', 'query_and_fetch'],
terminate_after: 10,
analyze_wildcard: '__flag__',
preference: ['_primary', '_primary_first', '_local', '_only_node:xyz', '_prefer_node:xyz', '_shards:2,3'],
scroll: '5m',
scroll_id: '',
routing: '',
request_cache: ['true', 'false']
},
data_autocomplete_rules: {
query: {
// populated by a global rule
},
aggs: {
__template: {
'NAME': {
'AGG_TYPE': {}
}
}
},
post_filter: {
__scope_link: 'GLOBAL.filter'
},
size: {
__template: 20
},
from: 0,
sort: {
__template: [
{
'FIELD': {
'order': 'desc'
}
}
],
__any_of: [
{
'{field}': {
'order': {
__one_of: ['desc', 'asc']
},
missing: {
__one_of: ['_last', '_first']
},
mode: {
__one_of: ['min', 'max', 'avg', 'sum']
},
nested_path: '',
nested_filter: {
__scope_link: 'GLOBAL.filter'
}
}
},
'{field}',
'_score',
{
'_geo_distance': {
__template: {
'FIELD': {
lat: 40,
lon: -70
},
order: 'asc'
},
'{field}': {
__one_of: [
{
__template: {
lat: 40,
lon: -70
},
lat: 40,
lon: -70
},
[
{
__template: {
lat: 40,
lon: -70
},
lat: 40,
lon: -70
}
],
[''],
''
]
},
distance_type: { __one_of: ['sloppy_arc', 'arc', 'plane'] },
sort_mode: { __one_of: ['min', 'max', 'avg'] },
order: { __one_of: ['asc', 'desc'] },
unit: 'km'
}
}
]
},
stored_fields: ['{field}'],
docvalue_fields: ['{field}'],
script_fields: {
__template: {
'FIELD': {
'script': {
// populated by a global rule
}
}
},
'*': {
__scope_link: 'GLOBAL.script'
}
},
partial_fields: {
__template: {
'NAME': {
include: []
}
},
'*': {
include: [],
exclude: []
}
},
highlight: {
// populated by a global rule
},
_source: {
__one_of: [
'{field}',
['{field}'],
{
'includes': {
__one_of: [
'{field}',
['{field}']
]
},
'excludes': {
__one_of: [
'{field}',
['{field}']
]
}
}
]
},
explain: {
__one_of: [true, false]
},
stats: [''],
timeout: '1s',
version: { __one_of: [true, false] }
}
});
api.addEndpointDescription('_search_template', {
methods: ['GET'],
patterns: [
'{indices}/{types}/_search/template',
'{indices}/_search/template',
'_search/template'
],
data_autocomplete_rules: {
'template': {
__one_of: [
{ __scope_link: '_search' },
{ __scope_link: 'GLOBAL.script' }
]
},
'params': {}
}
});
api.addEndpointDescription('_render_search_template', {
methods: ['GET'],
patterns: [
'_render/template'
],
data_autocomplete_rules: {
__one_of: [
{ 'inline': { __scope_link: '_search' } },
{ __scope_link: 'GLOBAL.script' }
],
'params': {}
}
});
api.addEndpointDescription('_render_search_template_with_id', {
methods: ['GET'],
patterns: [
'_render/template/{id}'
],
data_autocomplete_rules: {
'params': {}
}
});
api.addEndpointDescription('_get_delete_search_template', {
methods: ['GET', 'DELETE'],
patterns: [
'_search/template/{id}'
]
});
api.addEndpointDescription('_put_search_template', {
methods: ['PUT'],
patterns: [
'_search/template/{id}'
],
data_autocomplete_rules: {
'template': {
__scope_link: '_search'
}
}
});
api.addEndpointDescription('_search_shards', {
methods: ['GET'],
priority: 10, // collides with get doc by id
patterns: [
'{indices}/{types}/_search_shards',
'{indices}/_search_shards',
'_search_shards'
],
url_params: {
preference: ['_primary', '_primary_first', '_local', '_only_node:xyz', '_prefer_node:xyz', '_shards:2,3'],
routing: '',
local: '__flag__'
}
});
}

View file

@ -0,0 +1,23 @@
import Api from './api';
import { getSpec } from './spec';
const ES_6_0 = new Api('es_6_0');
const spec = getSpec();
// adding generated specs
Object.keys(spec).forEach(endpoint => {
ES_6_0.addEndpointDescription(endpoint, spec[endpoint]);
});
//adding globals and custom API definitions
require('./es_6_0/aliases')(ES_6_0);
require('./es_6_0/aggregations')(ES_6_0);
require('./es_6_0/document')(ES_6_0);
require('./es_6_0/filter')(ES_6_0);
require('./es_6_0/globals')(ES_6_0);
require('./es_6_0/ingest')(ES_6_0);
require('./es_6_0/mappings')(ES_6_0);
require('./es_6_0/query')(ES_6_0);
require('./es_6_0/reindex')(ES_6_0);
require('./es_6_0/search')(ES_6_0);
export default ES_6_0;

View file

@ -0,0 +1,514 @@
/*eslint camelcase: 0*/
const significantTermsArgs = {
__template: {
field: '',
},
field: '{field}',
size: 10,
shard_size: 10,
shard_min_doc_count: 10,
min_doc_count: 10,
include: { __one_of: ['*', { pattern: '', flags: '' }] },
exclude: { __one_of: ['*', { pattern: '', flags: '' }] },
execution_hint: {
__one_of: ['map', 'global_ordinals', 'global_ordinals_hash'],
},
background_filter: {
__scope_link: 'GLOBAL.filter',
},
mutual_information: {
include_negatives: { __one_of: [true, false] },
},
chi_square: {
include_negatives: { __one_of: [true, false] },
background_is_superset: { __one_of: [true, false] },
},
percentage: {},
gnd: {
background_is_superset: { __one_of: [true, false] },
},
script_heuristic: {
__template: {
script: '_subset_freq/(_superset_freq - _subset_freq + 1)',
},
script: {
// populated by a global rule
},
},
};
const simple_metric = {
__template: { field: '' },
field: '{field}',
missing: 0,
script: {
// populated by a global rule
},
};
const field_metric = {
__template: { field: '' },
field: '{field}',
};
const gap_policy = {
__one_of: ['skip', 'insert_zeros'],
};
const simple_pipeline = {
__template: {
buckets_path: '',
},
buckets_path: '',
format: '',
gap_policy: gap_policy,
};
const rules = {
'*': {
aggs: {
__template: {
NAME: {
AGG_TYPE: {},
},
},
},
adjacency_matrix: {
filters: {}
},
diversified_sampler: {
shard_size: '',
field: ''
},
min: simple_metric,
max: simple_metric,
avg: simple_metric,
sum: simple_metric,
stats: simple_metric,
extended_stats: simple_metric,
value_count: {
__template: {
field: '',
},
field: '{field}',
script: {
// populated by a global rule
},
},
global: {},
filter: {},
filters: {
__template: {
filters: {
NAME: {},
},
},
filters: {
'*': { __scope_link: 'GLOBAL.filter' },
},
other_bucket: { __one_of: [true, false] },
other_bucket_key: '',
},
missing: field_metric,
nested: {
__template: {
path: '',
},
path: '',
},
reverse_nested: {
__template: {
path: '',
},
path: '',
},
terms: {
__template: {
field: '',
size: 10,
},
field: '{field}',
size: 10,
shard_size: 10,
order: {
__template: {
_term: 'asc',
},
_term: { __one_of: ['asc', 'desc'] },
_count: { __one_of: ['asc', 'desc'] },
'*': { __one_of: ['asc', 'desc'] },
},
min_doc_count: 10,
script: {
// populated by a global rule
},
include: '.*',
exclude: '.*',
execution_hint: {
__one_of: [
'map',
'global_ordinals',
'global_ordinals_hash',
'global_ordinals_low_cardinality',
],
},
show_term_doc_count_error: { __one_of: [true, false] },
collect_mode: { __one_of: ['depth_first', 'breadth_first'] },
missing: '',
},
significant_text: {
...significantTermsArgs,
filter_duplicate_text: '__flag__'
},
significant_terms: significantTermsArgs,
range: {
__template: {
field: '',
ranges: [{ from: 50, to: 100 }],
},
field: '{field}',
ranges: [{ to: 50, from: 100, key: '' }],
keyed: { __one_of: [true, false] },
script: {
// populated by a global rule
},
},
date_range: {
__template: {
field: '',
ranges: [{ from: 'now-10d/d', to: 'now' }],
},
field: '{field}',
format: 'MM-yyy',
ranges: [{ to: '', from: '', key: '' }],
keyed: { __one_of: [true, false] },
script: {
// populated by a global rule
},
},
ip_range: {
__template: {
field: '',
ranges: [{ from: '10.0.0.5', to: '10.0.0.10' }],
},
field: '{field}',
format: 'MM-yyy',
ranges: [{ to: '', from: '', key: '', mask: '10.0.0.127/25' }],
keyed: { __one_of: [true, false] },
script: {
// populated by a global rule
},
},
histogram: {
__template: {
field: 'price',
interval: 50,
},
field: '{field}',
interval: 50,
extended_bounds: {
__template: {
min: 0,
max: 50,
},
min: 0,
max: 50,
},
min_doc_count: 0,
order: {
__template: {
_key: 'asc',
},
_key: { __one_of: ['asc', 'desc'] },
_count: { __one_of: ['asc', 'desc'] },
'*': { __one_of: ['asc', 'desc'] },
},
keyed: { __one_of: [true, false] },
missing: 0,
},
date_histogram: {
__template: {
field: 'date',
interval: 'month',
},
field: '{field}',
interval: {
__one_of: [
'year',
'quarter',
'week',
'day',
'hour',
'minute',
'second',
],
},
min_doc_count: 0,
extended_bounds: {
__template: {
min: 'now/d',
max: 'now/d',
},
min: 'now/d',
max: 'now/d',
},
order: {
__template: {
_key: 'asc',
},
_key: { __one_of: ['asc', 'desc'] },
_count: { __one_of: ['asc', 'desc'] },
'*': { __one_of: ['asc', 'desc'] },
},
keyed: { __one_of: [true, false] },
pre_zone: '-01:00',
post_zone: '-01:00',
pre_zone_adjust_large_interval: { __one_of: [true, false] },
factor: 1000,
pre_offset: '1d',
post_offset: '1d',
format: 'yyyy-MM-dd',
time_zone: '00:00',
missing: '',
},
geo_distance: {
__template: {
field: 'location',
origin: { lat: 52.376, lon: 4.894 },
ranges: [{ from: 100, to: 300 }],
},
field: '{field}',
origin: { lat: 0.0, lon: 0.0 },
unit: { __one_of: ['mi', 'km', 'in', 'yd', 'm', 'cm', 'mm'] },
ranges: [{ from: 50, to: 100 }],
distance_type: { __one_of: ['arc', 'sloppy_arc', 'plane'] },
},
geohash_grid: {
__template: {
field: '',
precision: 3,
},
field: '{field}',
precision: { __one_of: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] },
size: 10,
shard_size: 10,
},
composite: {
__template: {
sources: [
{
NAME: {
AGG_TYPE: {},
},
},
],
},
sources: [
{
__scope_link: '.',
__template: {
NAME: {
AGG_TYPE: {},
},
},
},
],
size: 10,
after: {},
},
percentiles: {
__template: {
field: '',
percents: [1.0, 5.0, 25.0, 50.0, 75.0, 95.0, 99.0],
},
field: '{field}',
percents: {
__template: [1.0, 5.0, 25.0, 50.0, 75.0, 95.0, 99.0],
// mark type as list
__any_of: [],
},
script: {
// populated by a global rule
},
compression: 100,
method: { __one_of: ['hdr', 'tdigest'] },
missing: 0,
},
cardinality: {
__template: {
field: '',
},
precision_threshold: 100,
rehash: true,
script: {
// populated by a global rule
},
missing: '',
},
scripted_metric: {
__template: {
init_script: '',
map_script: '',
combine_script: '',
reduce_script: '',
},
init_script: {
__scope_link: 'GLOBAL.script',
},
map_script: {
__scope_link: 'GLOBAL.script',
},
combine_script: {
__scope_link: 'GLOBAL.script',
},
reduce_script: {
__scope_link: 'GLOBAL.script',
},
lang: 'groovy',
params: {},
reduce_params: {},
},
geo_bounds: {
__template: {
field: '',
},
field: '{field}',
wrap_longitude: { __one_of: [true, false] },
},
top_hits: {
__template: {
size: 10,
},
from: 0,
size: 10,
sort: {
__template: [],
__scope_link: 'search.sort',
},
highlight: {},
explain: { __one_of: [true, false] },
_source: {
__template: '',
__scope_link: 'search._source',
},
script_fields: {
__scope_link: 'search.script_fields',
},
docvalue_fields: ['{field}'],
version: { __one_of: [true, false] },
},
percentile_ranks: {
__template: {
field: '',
values: [10, 15],
},
field: '{field}',
values: [],
script: {
// populated by a global rule
},
compression: 100,
method: { __one_of: ['hdr', 'tdigest'] },
missing: 0,
},
sampler: {
__template: {},
field: '{field}',
script: {
// populated by a global rule
},
shard_size: 100,
max_docs_per_value: 3,
execution_hint: { __one_of: ['map', 'global_ordinals', 'bytes_hash'] },
},
children: {
__template: {
type: '',
},
type: '',
},
derivative: simple_pipeline,
avg_bucket: simple_pipeline,
max_bucket: simple_pipeline,
min_bucket: simple_pipeline,
stats_bucket: simple_pipeline,
extended_stats_bucket: {
...simple_pipeline,
sigma: ''
},
percentiles_bucket: {
...simple_pipeline,
percents: []
},
sum_bucket: simple_pipeline,
moving_avg: {
__template: {
buckets_path: '',
},
buckets_path: '',
format: '',
gap_policy: gap_policy,
window: 5,
model: { __one_of: ['simple', 'linear', 'ewma', 'holt', 'holt_winters'] },
settings: {
type: { __one_of: ['add', 'mult'] },
alpha: 0.5,
beta: 0.5,
gamma: 0.5,
period: 7,
},
},
cumulative_sum: {
__template: {
buckets_path: '',
},
buckets_path: '',
format: '',
},
serial_diff: {
__template: {
buckets_path: '',
lag: 7,
},
lag: 7,
gap_policy: gap_policy,
buckets_path: '',
format: '',
},
bucket_script: {
__template: {
buckets_path: {},
script: '',
},
buckets_path: {},
format: '',
gap_policy: gap_policy,
script: '',
},
bucket_selector: {
__template: {
buckets_path: {},
script: '',
},
buckets_path: {},
gap_policy: gap_policy,
script: '',
},
bucket_sort: {
__template: {
sort: [],
},
sort: ['{field}'],
from: 0,
size: 0,
gap_policy: gap_policy,
},
matrix_stats: {
__template: {
fields: [],
},
fields: ['{field}'],
},
},
};
export default function (api) {
api.addGlobalAutocompleteRules('aggregations', rules);
api.addGlobalAutocompleteRules('aggs', rules);
}

View file

@ -0,0 +1,11 @@
export default function (api) {
const aliasRules = {
filter: {},
routing: '1',
search_routing: '1,2',
index_routing: '1'
};
api.addGlobalAutocompleteRules('aliases', {
'*': aliasRules
});
}

View file

@ -0,0 +1,60 @@
export default function (api) {
api.addEndpointDescription('update', {
data_autocomplete_rules: {
'script': {
// populated by a global rule
},
'doc': {},
'upsert': {},
'scripted_upsert': { __one_of: [true, false] }
}
});
api.addEndpointDescription('put_script', {
methods: ['POST', 'PUT'],
patterns: [
'_scripts/{lang}/{id}',
'_scripts/{lang}/{id}/_create'
],
url_components: {
'lang': [
'groovy',
'expressions'
]
},
data_autocomplete_rules: {
'script': ''
}
});
api.addEndpointDescription('termvectors', {
data_autocomplete_rules: {
fields: [
'{field}'
],
offsets: { __one_of: [false, true] },
payloads: { __one_of: [false, true] },
positions: { __one_of: [false, true] },
term_statistics: { __one_of: [true, false] },
field_statistics: { __one_of: [false, true] },
per_field_analyzer: {
__template: { 'FIELD': '' },
'{field}': ''
},
routing: '',
version: 1,
version_type: ['external', 'external_gt', 'external_gte', 'force', 'internal'],
doc: {},
filter: { // TODO: Exclude from global filter rules
'max_num_terms': 1,
'min_term_freq': 1,
'max_term_freq': 1,
'min_doc_freq': 1,
'max_doc_freq': 1,
'min_word_length': 1,
'max_word_length': 1
}
}
});
}

View file

@ -0,0 +1,54 @@
const highlightOptions = {
boundary_chars: {},
boundary_max_scan: 20,
boundary_scanner: {
__one_of: [ 'chars', 'sentence', 'word' ]
},
boundary_scanner_locale: {},
encoder: {
__one_of: [ 'default', 'html' ]
},
force_source: {
__one_of: [ 'false', 'true' ]
},
fragmenter: {
__one_of: [ 'simple', 'span' ]
},
highlight_query: {
__scope_link: 'GLOBAL.query'
},
matched_fields: ['FIELD'],
order: {},
no_match_size: 0,
number_of_fragments: 5,
phrase_limit: 256,
pre_tags: {},
post_tags: {},
require_field_match: {
__one_of: [ 'true', 'false' ]
},
tags_schema: {}
};
export default function (api) {
api.addGlobalAutocompleteRules('highlight', {
...highlightOptions,
fields: {
'{field}': {
fragment_size: 20,
number_of_fragments: 3,
...highlightOptions
}
}
});
api.addGlobalAutocompleteRules('script', {
__template: {
inline: 'SCRIPT'
},
inline: 'SCRIPT',
file: 'FILE_SCRIPT_NAME',
id: 'SCRIPT_ID',
lang: '',
params: {}
});
}

View file

@ -325,9 +325,6 @@ const pipelineDefinition = {
version: 123,
};
const simulateUrlParamsDefinition = {
"verbose": "__flag__"
};
export default function (api) {
@ -337,50 +334,21 @@ export default function (api) {
data_autocomplete_rules: processorDefinition
});
api.addEndpointDescription('_put_ingest_pipeline', {
api.addEndpointDescription('ingest.put_pipeline', {
methods: ['PUT'],
patterns: [
'_ingest/pipeline/{name}'
'_ingest/pipeline/{id}'
],
data_autocomplete_rules: pipelineDefinition
});
api.addEndpointDescription('_get_ingest_pipeline', {
methods: ['GET'],
patterns: [
'_ingest/pipeline/{id}'
]
});
api.addEndpointDescription('_delete_ingest_pipeline', {
methods: ['DELETE'],
patterns: [
'_ingest/pipeline/{id}'
]
});
api.addEndpointDescription('_simulate_new_ingest_pipeline', {
methods: ['POST'],
patterns: [
'_ingest/pipeline/_simulate'
],
url_params: simulateUrlParamsDefinition,
api.addEndpointDescription('ingest.simulate', {
data_autocomplete_rules: {
pipeline: pipelineDefinition,
docs: [
]
}
});
api.addEndpointDescription('_simulate_existing_ingest_pipeline', {
methods: ['POST'],
patterns: [
'_ingest/pipeline/{name}/_simulate'
],
url_params: simulateUrlParamsDefinition,
data_autocomplete_rules: {
docs: [
]
}
});
}

View file

@ -1,16 +1,11 @@
let _ = require("lodash");
const _ = require('lodash');
var BOOLEAN = {
const BOOLEAN = {
__one_of: [true, false]
};
export default function (api) {
api.addEndpointDescription('_put_type_mapping', {
methods: ['PUT', 'POST'],
patterns: [
"{indices}/{type}/_mapping",
"{indices}/_mapping/{type}"
],
api.addEndpointDescription('put_mapping', {
priority: 10, // collides with put doc by id
data_autocomplete_rules: {
__template: {
@ -42,7 +37,7 @@ export default function (api) {
'_timestamp': {
'enabled': BOOLEAN,
'format': 'YYYY-MM-dd',
'default': ""
'default': ''
},
'dynamic_date_formats': ['yyyy-MM-dd'],
'date_detection': BOOLEAN,
@ -51,7 +46,7 @@ export default function (api) {
'*': {
type: {
__one_of: ['text', 'keyword', 'float', 'half_float', 'scaled_float', 'double', 'byte', 'short', 'integer', 'long', 'date', 'boolean',
'binary', 'object', 'nested', "geo_point", "geo_shape"
'binary', 'object', 'nested', 'geo_point', 'geo_shape'
]
},
@ -129,14 +124,14 @@ export default function (api) {
'week_date', 'week_date_time', 'week_date_time_no_millis'], function (s) {
return ['basic_' + s, 'strict_' + s];
}),
[
'date', 'date_hour', 'date_hour_minute', 'date_hour_minute_second', 'date_hour_minute_second_fraction',
'date_hour_minute_second_millis', 'date_optional_time', 'date_time', 'date_time_no_millis',
'hour', 'hour_minute', 'hour_minute_second', 'hour_minute_second_fraction', 'hour_minute_second_millis',
'ordinal_date', 'ordinal_date_time', 'ordinal_date_time_no_millis', 'time', 'time_no_millis',
't_time', 't_time_no_millis', 'week_date', 'week_date_time', 'weekDateTimeNoMillis', 'week_year',
'weekyearWeek', 'weekyearWeekDay', 'year', 'year_month', 'year_month_day', 'epoch_millis', 'epoch_second'
]])
[
'date', 'date_hour', 'date_hour_minute', 'date_hour_minute_second', 'date_hour_minute_second_fraction',
'date_hour_minute_second_millis', 'date_optional_time', 'date_time', 'date_time_no_millis',
'hour', 'hour_minute', 'hour_minute_second', 'hour_minute_second_fraction', 'hour_minute_second_millis',
'ordinal_date', 'ordinal_date_time', 'ordinal_date_time_no_millis', 'time', 'time_no_millis',
't_time', 't_time_no_millis', 'week_date', 'week_date_time', 'weekDateTimeNoMillis', 'week_year',
'weekyearWeek', 'weekyearWeekDay', 'year', 'year_month', 'year_month_day', 'epoch_millis', 'epoch_second'
]])
},
fielddata: {
@ -155,13 +150,13 @@ export default function (api) {
// objects
properties: {
__scope_link: '_put_mapping.{type}.properties'
__scope_link: 'put_mapping.{type}.properties'
},
// multi_field
fields: {
'*': {
__scope_link: '_put_mapping.type.properties.field'
__scope_link: 'put_mapping.type.properties.field'
}
},
copy_to: { __one_of: ['{field}', ['{field}']] },
@ -174,15 +169,4 @@ export default function (api) {
}
});
api.addEndpointDescription('_put_mapping', {
methods: ['PUT'],
patterns: [
"{indices}/_mapping"
],
data_autocomplete_rules: {
'{type}': {
__scope_link: '_put_type_mapping'
}
}
});
}

View file

@ -1,6 +1,60 @@
let _ = require("lodash");
import _ from 'lodash';
var SPAN_QUERIES = {
const matchOptions = {
cutoff_frequency: 0.001,
query: '',
operator: {
__one_of: ['and', 'or']
},
zero_terms_query: {
__one_of: ['none', 'all']
},
max_expansions: 10,
analyzer: '',
boost: 1.0,
lenient: {
__one_of: [ 'true', 'false' ]
},
fuzzy_transpositions: {
__one_of: [ 'true', 'false' ]
},
auto_generate_synonyms_phrase_query: {
__one_of: [ 'true', 'false' ]
},
fuzziness: 1.0,
prefix_length: 1,
minimum_should_match: 1
};
const innerHits = {
docvalue_fields: [
'FIELD'
],
from: {},
size: {},
sort: {},
name: {},
highlight: {},
'_source': {
__one_of: [ 'true', 'false' ]
},
'explain': {
__one_of: [ 'true', 'false' ]
},
script_fields: {
__template: {
'FIELD': {
script: {}
}
},
'{field}': {
script: {}
}
},
version: {
__one_of: [ 'true', 'false' ]
}
};
const SPAN_QUERIES = {
// TODO add one_of for objects
span_first: {
__scope_link: '.span_first'
@ -25,47 +79,47 @@ var SPAN_QUERIES = {
}
};
var DECAY_FUNC_DESC = {
__template: {
"FIELD": {
"origin": "",
"scale": ""
}
},
"{field}": {
"origin": "",
"scale": "",
"offset": "",
"decay": 0.5
const DECAY_FUNC_DESC = {
__template: {
'FIELD': {
'origin': '',
'scale': ''
}
},
SCORING_FUNCS = {
"script_score": {
__template: {
"script": "_score * doc['f'].value"
},
"script": {
//populated by a global rule
}
'{field}': {
'origin': '',
'scale': '',
'offset': '',
'decay': 0.5
}
};
const SCORING_FUNCS = {
'script_score': {
__template: {
'script': '_score * doc[\'f\'].value'
},
"boost_factor": 2.0,
"random_score": {
"seed": 314159265359
},
"linear": DECAY_FUNC_DESC,
"exp": DECAY_FUNC_DESC,
"gauss": DECAY_FUNC_DESC,
"field_value_factor": {
__template: {
"field": ""
},
"field": "{field}",
"factor": 1.2,
"modifier": {
__one_of: ["none", "log", "log1p", "log2p", "ln", "ln1p", "ln2p", "square", "sqrt", "reciprocal"]
}
'script': {
//populated by a global rule
}
};
},
'boost_factor': 2.0,
'random_score': {
'seed': 314159265359
},
'linear': DECAY_FUNC_DESC,
'exp': DECAY_FUNC_DESC,
'gauss': DECAY_FUNC_DESC,
'field_value_factor': {
__template: {
'field': ''
},
'field': '{field}',
'factor': 1.2,
'modifier': {
__one_of: ['none', 'log', 'log1p', 'log2p', 'ln', 'ln1p', 'ln2p', 'square', 'sqrt', 'reciprocal']
}
}
};
export default function (api) {
api.addGlobalAutocompleteRules('query', {
@ -74,18 +128,10 @@ export default function (api) {
'FIELD': 'TEXT'
},
'{field}': {
'query': '',
'operator': {
__one_of: ['and', 'or']
},
'type': {
__one_of: ['phrase', 'phrase_prefix', 'boolean']
},
'max_expansions': 10,
'analyzer': '',
'fuzziness': 1.0,
'prefix_length': 1,
'minimum_should_match': 1
...matchOptions
}
},
match_phrase: {
@ -94,7 +140,8 @@ export default function (api) {
},
'{field}': {
query: '',
analyzer: ''
analyzer: '',
slop: 1
}
},
match_phrase_prefix: {
@ -114,7 +161,7 @@ export default function (api) {
'query': '',
'fields': []
},
query: '',
...matchOptions,
fields: ['{field}'],
use_dis_max: {
__template: true,
@ -181,6 +228,9 @@ export default function (api) {
}
]
},
exists: {
field: ''
},
field: {
'{field}': {
query: '',
@ -204,6 +254,7 @@ export default function (api) {
type: 'TYPE',
query: {}
},
inner_hits: { ...innerHits },
'type': '{type}',
'score_mode': {
__one_of: ['none', 'max', 'sum', 'avg']
@ -247,11 +298,11 @@ export default function (api) {
boost: 1.0,
analyzer: '',
docs: [{
_index: "{index}",
_type: "{type}",
_id: ""
_index: '{index}',
_type: '{type}',
_id: ''
}],
ids: [""]
ids: ['']
},
mlt: {
__template: {
@ -260,7 +311,7 @@ export default function (api) {
'min_term_freq': 1,
'max_query_terms': 12
},
__scope_link: ".more_like_this"
__scope_link: '.more_like_this'
},
prefix: {
__template: {
@ -310,19 +361,19 @@ export default function (api) {
__one_of: [true, false]
},
tie_breaker: 0,
time_zone: "+1:00"
time_zone: '+1:00'
},
simple_query_string: {
__template: {
query: "",
query: '',
fields: []
},
query: "",
fields: ["{field}"],
default_operator: { __one_of: ["OR", "AND"] },
analyzer: "",
flags: "OR|AND|PREFIX",
locale: "ROOT",
query: '',
fields: ['{field}'],
default_operator: { __one_of: ['OR', 'AND'] },
analyzer: '',
flags: 'OR|AND|PREFIX',
locale: 'ROOT',
lenient: { __one_of: [true, false] }
},
range: {
@ -341,9 +392,9 @@ export default function (api) {
gt: 10,
lte: 20,
lt: 20,
time_zone: "+1:00",
time_zone: '+1:00',
boost: 1.0,
"format": "dd/MM/yyyy||yyyy"
'format': 'dd/MM/yyyy||yyyy'
}
},
@ -457,8 +508,8 @@ export default function (api) {
}
}
],
"slop": 5,
"in_order": false
'slop': 5,
'in_order': false
}
}
},
@ -492,8 +543,8 @@ export default function (api) {
}
}
],
"slop": 5,
"in_order": false
'slop': 5,
'in_order': false
}
}
},
@ -533,12 +584,28 @@ export default function (api) {
path: 'path_to_nested_doc',
query: {}
},
inner_hits: { ...innerHits },
path: '',
query: {},
score_mode: {
__one_of: ['avg', 'total', 'max', 'none']
}
},
common: {
__template: {
'FIELD': {
query: {}
}
},
'{field}': {
query: {},
cutoff_frequency: 0.001,
minimum_should_match: {
low_freq: {},
high_freq: {}
}
}
},
custom_filters_score: {
__template: {
query: {},
@ -586,33 +653,33 @@ export default function (api) {
// js hint gets confused here
/* jshint -W015 */
function_score: _.defaults({
__template: {
query: {},
functions: [
{}
]
},
__template: {
query: {},
functions: [
_.defaults(
{
filter: {},
weight: 1.0
},
SCORING_FUNCS
)
],
boost: 1.0,
boost_mode: { __one_of: ["multiply", "replace", "sum", "avg", "max", "min"] },
score_mode: { __one_of: ["multiply", "sum", "first", "avg", "max", "min"] },
max_boost: 10,
min_score: 1.0
{}
]
},
SCORING_FUNCS
query: {},
functions: [
_.defaults(
{
filter: {},
weight: 1.0
},
SCORING_FUNCS
)
],
boost: 1.0,
boost_mode: { __one_of: ['multiply', 'replace', 'sum', 'avg', 'max', 'min'] },
score_mode: { __one_of: ['multiply', 'sum', 'first', 'avg', 'max', 'min'] },
max_boost: 10,
min_score: 1.0
},
SCORING_FUNCS
),
script: {
__template: {
"script": "_score * doc['f'].value"
'script': '_score * doc[\'f\'].value'
},
script: {
//populated by a global rule

View file

@ -1,18 +1,10 @@
export default function (api) {
api.addEndpointDescription('_post_reindex', {
api.addEndpointDescription('reindex', {
methods: [ 'POST' ],
patterns: [
'_reindex'
],
url_params: {
refresh: '__flag__',
wait_for_completion: 'true',
wait_for_active_shards: 1,
timeout: '1m',
requests_per_second: 0,
slices: 1
},
data_autocomplete_rules: {
__template: {
'source': {},
@ -53,5 +45,5 @@ export default function (api) {
'size': 10,
'script': { __scope_link: 'GLOBAL.script' },
}
})
});
}

View file

@ -0,0 +1,205 @@
export default function (api) {
api.addEndpointDescription('search', {
priority: 10, // collides with get doc by id
data_autocomplete_rules: {
query: {
// populated by a global rule
},
profile: {
__one_of: ['true', 'false'],
},
aggs: {
__template: {
NAME: {
AGG_TYPE: {},
},
},
},
post_filter: {
__scope_link: 'GLOBAL.filter',
},
size: {
__template: 20,
},
from: 0,
sort: {
__template: [
{
FIELD: {
order: 'desc',
},
},
],
__any_of: [
{
'{field}': {
order: {
__one_of: ['desc', 'asc'],
},
missing: {
__one_of: ['_last', '_first'],
},
mode: {
__one_of: ['min', 'max', 'avg', 'sum'],
},
nested_path: '',
nested_filter: {
__scope_link: 'GLOBAL.filter',
},
},
},
'{field}',
'_score',
{
_geo_distance: {
__template: {
FIELD: {
lat: 40,
lon: -70,
},
order: 'asc',
},
'{field}': {
__one_of: [
{
__template: {
lat: 40,
lon: -70,
},
lat: 40,
lon: -70,
},
[
{
__template: {
lat: 40,
lon: -70,
},
lat: 40,
lon: -70,
},
],
[''],
'',
],
},
distance_type: { __one_of: ['sloppy_arc', 'arc', 'plane'] },
sort_mode: { __one_of: ['min', 'max', 'avg'] },
order: { __one_of: ['asc', 'desc'] },
unit: 'km',
},
},
],
},
stored_fields: ['{field}'],
suggest: {
__template: {
YOUR_SUGGESTION: {
text: 'YOUR TEXT',
term: {
FIELD: 'MESSAGE',
},
},
},
'*': {
include: [],
exclude: [],
},
},
docvalue_fields: ['{field}'],
collapse: {
__template: {
'field': 'FIELD'
}
},
indices_boost: {
__template: [
{ 'INDEX': 1.0 }
]
},
rescore: {
__template: {
'query': {},
'window_size': 50
}
},
script_fields: {
__template: {
FIELD: {
script: {
// populated by a global rule
},
},
},
'*': {
__scope_link: 'GLOBAL.script',
},
},
partial_fields: {
__template: {
NAME: {
include: [],
},
},
'*': {
include: [],
exclude: [],
},
},
highlight: {
// populated by a global rule
},
_source: {
__one_of: [
'{field}',
['{field}'],
{
includes: {
__one_of: ['{field}', ['{field}']],
},
excludes: {
__one_of: ['{field}', ['{field}']],
},
},
],
},
explain: {
__one_of: [true, false],
},
stats: [''],
timeout: '1s',
version: { __one_of: [true, false] },
},
});
api.addEndpointDescription('search_template', {
data_autocomplete_rules: {
template: {
__one_of: [
{ __scope_link: 'search' },
{ __scope_link: 'GLOBAL.script' },
],
},
params: {},
},
});
api.addEndpointDescription('render_search_template', {
data_autocomplete_rules: {
__one_of: [
{ inline: { __scope_link: 'search' } },
{ __scope_link: 'GLOBAL.script' },
],
params: {},
},
});
api.addEndpointDescription('_search/template/{id}', {
data_autocomplete_rules: {
template: {
__scope_link: 'search',
},
},
});
}

View file

@ -1,14 +1,14 @@
let _ = require("lodash");
import _ from 'lodash';
export function resolveApi(sense_version, apis, reply) {
let result = {};
export function resolveApi(senseVersion, apis, reply) {
const result = {};
_.each(apis, function (name) {
{
// for now we ignore sense_version. might add it in the api name later
let api = require('./' + name);
const api = require('./' + name);
result[name] = api.asJson();
}
});
return reply(result).type("application/json");
return reply(result).type('application/json');
}

View file

@ -0,0 +1 @@
{}

View file

@ -1,6 +1,7 @@
{
"_bulk": {
"bulk": {
"url_params": {
"include_type_name": "",
"wait_for_active_shards": "",
"refresh": [
"true",
@ -10,7 +11,6 @@
"routing": "",
"timeout": "",
"type": "",
"fields": [],
"_source": [],
"_source_exclude": [],
"_source_include": [],
@ -24,6 +24,7 @@
"_bulk",
"{indices}/_bulk",
"{indices}/{type}/_bulk"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-bulk.html"
}
}

View file

@ -1,5 +1,5 @@
{
"_cat/aliases": {
"cat.aliases": {
"url_params": {
"format": "",
"local": "__flag__",
@ -15,6 +15,7 @@
"patterns": [
"_cat/aliases",
"_cat/aliases/{name}"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-alias.html"
}
}

View file

@ -1,5 +1,5 @@
{
"_cat/allocation": {
"cat.allocation": {
"url_params": {
"format": "",
"bytes": [
@ -28,6 +28,7 @@
"patterns": [
"_cat/allocation",
"_cat/allocation/{nodes}"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-allocation.html"
}
}

View file

@ -1,5 +1,5 @@
{
"_cat/count": {
"cat.count": {
"url_params": {
"format": "",
"local": "__flag__",
@ -15,6 +15,7 @@
"patterns": [
"_cat/count",
"_cat/count/{indices}"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-count.html"
}
}

View file

@ -1,5 +1,5 @@
{
"_cat/fielddata": {
"cat.fielddata": {
"url_params": {
"format": "",
"bytes": [
@ -29,6 +29,7 @@
"patterns": [
"_cat/fielddata",
"_cat/fielddata/{fields}"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-fielddata.html"
}
}

View file

@ -1,5 +1,5 @@
{
"_cat/health": {
"cat.health": {
"url_params": {
"format": "",
"local": "__flag__",
@ -15,6 +15,7 @@
],
"patterns": [
"_cat/health"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-health.html"
}
}

View file

@ -1,5 +1,5 @@
{
"_cat": {
"cat.help": {
"url_params": {
"help": "__flag__",
"s": []
@ -9,6 +9,7 @@
],
"patterns": [
"_cat"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cat.html"
}
}

View file

@ -1,5 +1,5 @@
{
"_cat/indices": {
"cat.indices": {
"url_params": {
"format": "",
"bytes": [
@ -27,6 +27,7 @@
"patterns": [
"_cat/indices",
"_cat/indices/{indices}"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-indices.html"
}
}

View file

@ -1,5 +1,5 @@
{
"_cat/master": {
"cat.master": {
"url_params": {
"format": "",
"local": "__flag__",
@ -14,6 +14,7 @@
],
"patterns": [
"_cat/master"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-master.html"
}
}

View file

@ -1,5 +1,5 @@
{
"_cat/nodeattrs": {
"cat.nodeattrs": {
"url_params": {
"format": "",
"local": "__flag__",
@ -14,6 +14,7 @@
],
"patterns": [
"_cat/nodeattrs"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodeattrs.html"
}
}

View file

@ -1,5 +1,5 @@
{
"_cat/nodes": {
"cat.nodes": {
"url_params": {
"format": "",
"full_id": "__flag__",
@ -15,6 +15,7 @@
],
"patterns": [
"_cat/nodes"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodes.html"
}
}

View file

@ -1,5 +1,5 @@
{
"_cat/pending_tasks": {
"cat.pending_tasks": {
"url_params": {
"format": "",
"local": "__flag__",
@ -14,6 +14,7 @@
],
"patterns": [
"_cat/pending_tasks"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-pending-tasks.html"
}
}

View file

@ -1,5 +1,5 @@
{
"_cat/plugins": {
"cat.plugins": {
"url_params": {
"format": "",
"local": "__flag__",
@ -14,6 +14,7 @@
],
"patterns": [
"_cat/plugins"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-plugins.html"
}
}

View file

@ -1,5 +1,5 @@
{
"_cat/recovery": {
"cat.recovery": {
"url_params": {
"format": "",
"bytes": [
@ -27,6 +27,7 @@
"patterns": [
"_cat/recovery",
"_cat/recovery/{indices}"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-recovery.html"
}
}

View file

@ -1,5 +1,5 @@
{
"_cat/repositories": {
"cat.repositories": {
"url_params": {
"format": "",
"local": "__flag__",
@ -14,6 +14,7 @@
],
"patterns": [
"_cat/repositories"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-repositories.html"
}
}

View file

@ -1,5 +1,5 @@
{
"_cat/segments": {
"cat.segments": {
"url_params": {
"format": "",
"bytes": [
@ -26,6 +26,7 @@
"patterns": [
"_cat/segments",
"_cat/segments/{indices}"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-segments.html"
}
}

View file

@ -1,5 +1,5 @@
{
"_cat/shards": {
"cat.shards": {
"url_params": {
"format": "",
"bytes": [
@ -28,6 +28,7 @@
"patterns": [
"_cat/shards",
"_cat/shards/{indices}"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-shards.html"
}
}

View file

@ -1,5 +1,5 @@
{
"_cat/snapshots": {
"cat.snapshots": {
"url_params": {
"format": "",
"ignore_unavailable": "__flag__",
@ -15,6 +15,7 @@
"patterns": [
"_cat/snapshots",
"_cat/snapshots/{repository}"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-snapshots.html"
}
}

View file

@ -1,11 +1,10 @@
{
"_cat/tasks": {
"cat.tasks": {
"url_params": {
"format": "",
"node_id": [],
"actions": [],
"detailed": "__flag__",
"parent_node": "",
"parent_task": "",
"h": [],
"help": "__flag__",
@ -17,6 +16,7 @@
],
"patterns": [
"_cat/tasks"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html"
}
}

View file

@ -1,5 +1,5 @@
{
"_cat/templates": {
"cat.templates": {
"url_params": {
"format": "",
"local": "__flag__",
@ -15,6 +15,7 @@
"patterns": [
"_cat/templates",
"_cat/templates/{name}"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-templates.html"
}
}

View file

@ -1,5 +1,5 @@
{
"_cat/thread_pool": {
"cat.thread_pool": {
"url_params": {
"format": "",
"size": [
@ -23,6 +23,7 @@
"patterns": [
"_cat/thread_pool",
"_cat/thread_pool/{thread_pool_patterns}"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-thread-pool.html"
}
}

View file

@ -1,12 +1,12 @@
{
"_search/scroll/{scroll_id}": {
"url_params": {},
"clear_scroll": {
"methods": [
"DELETE"
],
"patterns": [
"_search/scroll/{scroll_id}",
"_search/scroll"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-scroll.html"
}
}

View file

@ -1,5 +1,5 @@
{
"_cluster/allocation/explain": {
"cluster.allocation_explain": {
"url_params": {
"include_yes_decisions": "__flag__",
"include_disk_info": "__flag__"
@ -10,6 +10,7 @@
],
"patterns": [
"_cluster/allocation/explain"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-allocation-explain.html"
}
}

View file

@ -1,5 +1,5 @@
{
"_cluster/settings": {
"cluster.get_settings": {
"url_params": {
"flat_settings": "__flag__",
"master_timeout": "",
@ -11,6 +11,7 @@
],
"patterns": [
"_cluster/settings"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-update-settings.html"
}
}

View file

@ -1,5 +1,5 @@
{
"_cluster/health": {
"cluster.health": {
"url_params": {
"level": [
"cluster",
@ -33,6 +33,7 @@
"patterns": [
"_cluster/health",
"_cluster/health/{indices}"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-health.html"
}
}

View file

@ -1,5 +1,5 @@
{
"_cluster/pending_tasks": {
"cluster.pending_tasks": {
"url_params": {
"local": "__flag__",
"master_timeout": ""
@ -9,6 +9,7 @@
],
"patterns": [
"_cluster/pending_tasks"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-pending.html"
}
}

View file

@ -1,5 +1,5 @@
{
"_cluster/settings": {
"cluster.put_settings": {
"url_params": {
"flat_settings": "__flag__",
"master_timeout": "",
@ -10,6 +10,7 @@
],
"patterns": [
"_cluster/settings"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-update-settings.html"
}
}

View file

@ -1,11 +1,11 @@
{
"_remote/info": {
"url_params": {},
"cluster.remote_info": {
"methods": [
"GET"
],
"patterns": [
"_remote/info"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-remote-info.html"
}
}

View file

@ -1,5 +1,5 @@
{
"_cluster/reroute": {
"cluster.reroute": {
"url_params": {
"dry_run": "__flag__",
"explain": "__flag__",
@ -13,6 +13,7 @@
],
"patterns": [
"_cluster/reroute"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-reroute.html"
}
}

View file

@ -1,5 +1,5 @@
{
"_cluster/state": {
"cluster.state": {
"url_params": {
"local": "__flag__",
"master_timeout": "",
@ -33,6 +33,7 @@
"routing_table",
"version"
]
}
},
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-state.html"
}
}

View file

@ -1,5 +1,5 @@
{
"_cluster/stats": {
"cluster.stats": {
"url_params": {
"flat_settings": "__flag__",
"timeout": ""
@ -10,6 +10,7 @@
"patterns": [
"_cluster/stats",
"_cluster/stats/nodes/{nodes}"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-stats.html"
}
}

View file

@ -1,5 +1,5 @@
{
"_count": {
"count": {
"url_params": {
"ignore_unavailable": "__flag__",
"allow_no_indices": "__flag__",
@ -31,6 +31,7 @@
"_count",
"{indices}/_count",
"{indices}/{type}/_count"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/search-count.html"
}
}

View file

@ -1,5 +1,5 @@
{
"{index}/{type}/{id}/_create": {
"create": {
"url_params": {
"wait_for_active_shards": "",
"parent": "",
@ -10,8 +10,6 @@
],
"routing": "",
"timeout": "",
"timestamp": "",
"ttl": "",
"version": "",
"version_type": [
"internal",
@ -27,6 +25,7 @@
],
"patterns": [
"{indices}/{type}/{id}/_create"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html"
}
}

View file

@ -1,6 +1,7 @@
{
"{index}/{type}/{id}": {
"delete": {
"url_params": {
"include_type_name": "",
"wait_for_active_shards": "",
"parent": "",
"refresh": [
@ -22,7 +23,9 @@
"DELETE"
],
"patterns": [
"{indices}/{type}/{id}"
]
"{indices}/{type}/{id}",
"{indices}/_doc/{id}"
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete.html"
}
}

View file

@ -1,5 +1,5 @@
{
"{index}/_delete_by_query": {
"delete_by_query": {
"url_params": {
"analyzer": "",
"analyze_wildcard": "__flag__",
@ -54,6 +54,7 @@
"patterns": [
"{indices}/_delete_by_query",
"{indices}/{type}/_delete_by_query"
]
],
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete-by-query.html"
}
}

View file

@ -1,5 +1,5 @@
{
"_scripts/{id}": {
"delete_script": {
"url_params": {
"timeout": "",
"master_timeout": ""
@ -9,6 +9,7 @@
],
"patterns": [
"_scripts/{id}"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html"
}
}

View file

@ -1,5 +1,5 @@
{
"{index}/{type}/{id}": {
"exists": {
"url_params": {
"stored_fields": [],
"parent": "",
@ -23,6 +23,7 @@
],
"patterns": [
"{indices}/{type}/{id}"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html"
}
}

View file

@ -1,5 +1,5 @@
{
"{index}/{type}/{id}/_source": {
"exists_source": {
"url_params": {
"parent": "",
"preference": "random",
@ -22,6 +22,7 @@
],
"patterns": [
"{indices}/{type}/{id}/_source"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html"
}
}

View file

@ -1,5 +1,5 @@
{
"{index}/{type}/{id}/_explain": {
"explain": {
"url_params": {
"analyze_wildcard": "__flag__",
"analyzer": "",
@ -24,6 +24,7 @@
],
"patterns": [
"{indices}/{type}/{id}/_explain"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/search-explain.html"
}
}

View file

@ -1,5 +1,5 @@
{
"_field_caps": {
"field_caps": {
"url_params": {
"fields": [],
"ignore_unavailable": "__flag__",
@ -18,6 +18,7 @@
"patterns": [
"_field_caps",
"{indices}/_field_caps"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/search-field-caps.html"
}
}

View file

@ -1,6 +1,7 @@
{
"{index}/{type}/{id}": {
"get": {
"url_params": {
"include_type_name": "",
"stored_fields": [],
"parent": "",
"preference": "random",
@ -22,7 +23,9 @@
"GET"
],
"patterns": [
"{indices}/{type}/{id}"
]
"{indices}/{type}/{id}",
"{indices}/_doc/{id}"
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html"
}
}

View file

@ -1,11 +1,11 @@
{
"_scripts/{id}": {
"url_params": {},
"get_script": {
"methods": [
"GET"
],
"patterns": [
"_scripts/{id}"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html"
}
}

View file

@ -1,5 +1,5 @@
{
"{index}/{type}/{id}/_source": {
"get_source": {
"url_params": {
"parent": "",
"preference": "random",
@ -22,6 +22,7 @@
],
"patterns": [
"{indices}/{type}/{id}/_source"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html"
}
}

View file

@ -1,6 +1,7 @@
{
"{index}/{type}": {
"index": {
"url_params": {
"include_type_name": "",
"wait_for_active_shards": "",
"op_type": [
"index",
@ -14,8 +15,6 @@
],
"routing": "",
"timeout": "",
"timestamp": "",
"ttl": "",
"version": "",
"version_type": [
"internal",
@ -31,7 +30,10 @@
],
"patterns": [
"{indices}/{type}",
"{indices}/{type}/{id}"
]
"{indices}/{type}/{id}",
"{indices}/_doc/{id}",
"{indices}/_doc"
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html"
}
}

View file

@ -1,5 +1,5 @@
{
"_analyze": {
"indices.analyze": {
"url_params": {
"index": "",
"prefer_local": "__flag__",
@ -15,6 +15,7 @@
"patterns": [
"_analyze",
"{indices}/_analyze"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-analyze.html"
}
}

View file

@ -1,7 +1,6 @@
{
"_cache/clear": {
"indices.clear_cache": {
"url_params": {
"field_data": "__flag__",
"fielddata": "__flag__",
"fields": [],
"query": "__flag__",
@ -14,8 +13,6 @@
"all"
],
"index": [],
"recycler": "__flag__",
"request_cache": "__flag__",
"request": "__flag__"
},
"methods": [
@ -25,6 +22,7 @@
"patterns": [
"_cache/clear",
"{indices}/_cache/clear"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-clearcache.html"
}
}

View file

@ -1,5 +1,5 @@
{
"{index}/_close": {
"indices.close": {
"url_params": {
"timeout": "",
"master_timeout": "",
@ -17,6 +17,7 @@
],
"patterns": [
"{indices}/_close"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-open-close.html"
}
}

View file

@ -1,16 +1,17 @@
{
"{index}": {
"indices.create": {
"url_params": {
"include_type_name": "",
"wait_for_active_shards": "",
"timeout": "",
"master_timeout": "",
"update_all_types": "__flag__"
"master_timeout": ""
},
"methods": [
"PUT"
],
"patterns": [
"{indices}"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-create-index.html"
}
}

View file

@ -1,5 +1,5 @@
{
"{index}": {
"indices.delete": {
"url_params": {
"timeout": "",
"master_timeout": "",
@ -17,6 +17,7 @@
],
"patterns": [
"{indices}"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-delete-index.html"
}
}

View file

@ -1,5 +1,5 @@
{
"{index}/_alias/{name}": {
"indices.delete_alias": {
"url_params": {
"timeout": "",
"master_timeout": ""
@ -10,6 +10,7 @@
"patterns": [
"{indices}/_alias/{name}",
"{indices}/_aliases/{name}"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html"
}
}

View file

@ -1,5 +1,5 @@
{
"_template/{name}": {
"indices.delete_template": {
"url_params": {
"timeout": "",
"master_timeout": ""
@ -9,6 +9,7 @@
],
"patterns": [
"_template/{name}"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html"
}
}

View file

@ -1,5 +1,5 @@
{
"{index}": {
"indices.exists": {
"url_params": {
"local": "__flag__",
"ignore_unavailable": "__flag__",
@ -18,6 +18,7 @@
],
"patterns": [
"{indices}"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-exists.html"
}
}

View file

@ -1,5 +1,5 @@
{
"_alias/{name}": {
"indices.exists_alias": {
"url_params": {
"ignore_unavailable": "__flag__",
"allow_no_indices": "__flag__",
@ -17,6 +17,7 @@
"patterns": [
"_alias/{name}",
"{indices}/_alias/{name}"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html"
}
}

View file

@ -1,5 +1,5 @@
{
"_template/{name}": {
"indices.exists_template": {
"url_params": {
"flat_settings": "__flag__",
"master_timeout": "",
@ -10,6 +10,7 @@
],
"patterns": [
"_template/{name}"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html"
}
}

View file

@ -1,5 +1,5 @@
{
"{index}/_mapping/{type}": {
"indices.exists_type": {
"url_params": {
"ignore_unavailable": "__flag__",
"allow_no_indices": "__flag__",
@ -16,6 +16,7 @@
],
"patterns": [
"{indices}/_mapping/{type}"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-types-exists.html"
}
}

View file

@ -1,5 +1,5 @@
{
"_flush": {
"indices.flush": {
"url_params": {
"force": "__flag__",
"wait_if_ongoing": "__flag__",
@ -19,6 +19,7 @@
"patterns": [
"_flush",
"{indices}/_flush"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-flush.html"
}
}

View file

@ -1,5 +1,5 @@
{
"_flush/synced": {
"indices.flush_synced": {
"url_params": {
"ignore_unavailable": "__flag__",
"allow_no_indices": "__flag__",
@ -17,6 +17,7 @@
"patterns": [
"_flush/synced",
"{indices}/_flush/synced"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-synced-flush.html"
}
}

View file

@ -1,5 +1,5 @@
{
"_forcemerge": {
"indices.forcemerge": {
"url_params": {
"flush": "__flag__",
"ignore_unavailable": "__flag__",
@ -11,8 +11,7 @@
"all"
],
"max_num_segments": "dynamic",
"only_expunge_deletes": "__flag__",
"wait_for_merge": "__flag__"
"only_expunge_deletes": "__flag__"
},
"methods": [
"POST"
@ -20,6 +19,7 @@
"patterns": [
"_forcemerge",
"{indices}/_forcemerge"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-forcemerge.html"
}
}

View file

@ -1,5 +1,5 @@
{
"{index}": {
"indices.get": {
"url_params": {
"local": "__flag__",
"ignore_unavailable": "__flag__",
@ -18,6 +18,7 @@
],
"patterns": [
"{indices}"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-index.html"
}
}

View file

@ -1,5 +1,5 @@
{
"_alias/": {
"indices.get_alias": {
"url_params": {
"ignore_unavailable": "__flag__",
"allow_no_indices": "__flag__",
@ -19,6 +19,7 @@
"_alias/{name}",
"{indices}/_alias/{name}",
"{indices}/_alias"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html"
}
}

View file

@ -1,5 +1,5 @@
{
"_mapping/field/{fields}": {
"indices.get_field_mapping": {
"url_params": {
"include_defaults": "__flag__",
"ignore_unavailable": "__flag__",
@ -20,6 +20,7 @@
"{indices}/_mapping/field/{fields}",
"_mapping/{type}/field/{fields}",
"{indices}/_mapping/{type}/field/{fields}"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-field-mapping.html"
}
}

View file

@ -1,6 +1,7 @@
{
"_mapping": {
"indices.get_mapping": {
"url_params": {
"include_type_name": "",
"ignore_unavailable": "__flag__",
"allow_no_indices": "__flag__",
"expand_wildcards": [
@ -19,6 +20,7 @@
"{indices}/_mapping",
"_mapping/{type}",
"{indices}/_mapping/{type}"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-mapping.html"
}
}

View file

@ -1,5 +1,5 @@
{
"_settings": {
"indices.get_settings": {
"url_params": {
"ignore_unavailable": "__flag__",
"allow_no_indices": "__flag__",
@ -21,6 +21,7 @@
"{indices}/_settings",
"{indices}/_settings/{name}",
"_settings/{name}"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-settings.html"
}
}

View file

@ -1,5 +1,5 @@
{
"_template/{name}": {
"indices.get_template": {
"url_params": {
"flat_settings": "__flag__",
"master_timeout": "",
@ -11,6 +11,7 @@
"patterns": [
"_template",
"_template/{name}"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html"
}
}

View file

@ -1,5 +1,5 @@
{
"_upgrade": {
"indices.get_upgrade": {
"url_params": {
"ignore_unavailable": "__flag__",
"allow_no_indices": "__flag__",
@ -16,6 +16,7 @@
"patterns": [
"_upgrade",
"{indices}/_upgrade"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-upgrade.html"
}
}

View file

@ -1,5 +1,5 @@
{
"{index}/_open": {
"indices.open": {
"url_params": {
"timeout": "",
"master_timeout": "",
@ -18,6 +18,7 @@
],
"patterns": [
"{indices}/_open"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-open-close.html"
}
}

View file

@ -1,5 +1,5 @@
{
"{index}/_alias/{name}": {
"indices.put_alias": {
"url_params": {
"timeout": "",
"master_timeout": ""
@ -11,6 +11,7 @@
"patterns": [
"{indices}/_alias/{name}",
"{indices}/_aliases/{name}"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html"
}
}

View file

@ -0,0 +1,32 @@
{
"put_mapping": {
"url_params": {
"include_type_name": "",
"timeout": "",
"master_timeout": "",
"ignore_unavailable": "__flag__",
"allow_no_indices": "__flag__",
"expand_wildcards": [
"open",
"closed",
"none",
"all"
]
},
"methods": [
"PUT",
"POST"
],
"patterns": [
"{indices}/{type}/_mapping",
"{indices}/_mapping/{type}",
"_mapping/{type}",
"{indices}/{type}/_mappings",
"{indices}/_mappings/{type}",
"_mappings/{type}",
"{indices}/_mappings",
"{indices}/_mapping"
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-put-mapping.html"
}
}

View file

@ -1,7 +1,8 @@
{
"_settings": {
"put_settings": {
"url_params": {
"master_timeout": "",
"timeout": "",
"preserve_existing": "__flag__",
"ignore_unavailable": "__flag__",
"allow_no_indices": "__flag__",
@ -19,6 +20,7 @@
"patterns": [
"_settings",
"{indices}/_settings"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-update-settings.html"
}
}

View file

@ -1,5 +1,5 @@
{
"_template/{name}": {
"indices.put_template": {
"url_params": {
"order": "",
"create": "__flag__",
@ -13,6 +13,7 @@
],
"patterns": [
"_template/{name}"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html"
}
}

View file

@ -1,5 +1,5 @@
{
"_recovery": {
"indices.recovery": {
"url_params": {
"detailed": "__flag__",
"active_only": "__flag__"
@ -10,6 +10,7 @@
"patterns": [
"_recovery",
"{indices}/_recovery"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-recovery.html"
}
}

View file

@ -1,5 +1,5 @@
{
"_refresh": {
"indices.refresh": {
"url_params": {
"ignore_unavailable": "__flag__",
"allow_no_indices": "__flag__",
@ -17,6 +17,7 @@
"patterns": [
"_refresh",
"{indices}/_refresh"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-refresh.html"
}
}

View file

@ -1,5 +1,5 @@
{
"{alias}/_rollover": {
"indices.rollover": {
"url_params": {
"timeout": "",
"dry_run": "__flag__",
@ -12,6 +12,7 @@
"patterns": [
"{alias}/_rollover",
"{alias}/_rollover/{new_index}"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-rollover-index.html"
}
}

View file

@ -1,5 +1,5 @@
{
"_segments": {
"indices.segments": {
"url_params": {
"ignore_unavailable": "__flag__",
"allow_no_indices": "__flag__",
@ -17,6 +17,7 @@
"patterns": [
"_segments",
"{indices}/_segments"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-segments.html"
}
}

View file

@ -1,5 +1,5 @@
{
"_shard_stores": {
"indices.shard_stores": {
"url_params": {
"status": [],
"ignore_unavailable": "__flag__",
@ -17,6 +17,7 @@
"patterns": [
"_shard_stores",
"{indices}/_shard_stores"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-shards-stores.html"
}
}

View file

@ -1,5 +1,5 @@
{
"{index}/_shrink/{target}": {
"indices.shrink": {
"url_params": {
"timeout": "",
"master_timeout": "",
@ -11,6 +11,7 @@
],
"patterns": [
"{indices}/_shrink/{target}"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-shrink-index.html"
}
}

View file

@ -1,5 +1,5 @@
{
"{index}/_split/{target}": {
"indices.split": {
"url_params": {
"timeout": "",
"master_timeout": "",
@ -11,6 +11,7 @@
],
"patterns": [
"{indices}/_split/{target}"
]
],
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-split-index.html"
}
}

View file

@ -1,5 +1,5 @@
{
"_stats": {
"indices.stats": {
"url_params": {
"completion_fields": [],
"fielddata_fields": [],
@ -42,6 +42,7 @@
"suggest",
"warmer"
]
}
},
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-stats.html"
}
}

Some files were not shown because too many files have changed in this diff Show more