Skip to content

Commit

Permalink
[console] assorted autocomplete fixes (elastic#14770)
Browse files Browse the repository at this point in the history
* [console] add miminum_should_match to match query

* [console] source include,exclude -> includes,excludes

* [console] Remove lowercase expanded terms

* [console] _source_{include,exclude} -> _source_{includes,excludes}

* [console] autocomplete for rollover api

* [console] autocomplete for extended_bounds
  • Loading branch information
jbudz authored and chrisronline committed Nov 20, 2017
1 parent c18d6c6 commit 4665144
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 14 deletions.
16 changes: 16 additions & 0 deletions src/core_plugins/console/api_server/es_5_0/aggregations.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,14 @@ var rules = {
},
"field": "{field}",
"interval": 50,
"extended_bounds": {
"__template": {
"min": 0,
"max": 50
},
"min": 0,
"max": 50
},
"min_doc_count": 0,
"order": {
__template: {
Expand All @@ -208,6 +216,14 @@ var rules = {
"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"
Expand Down
8 changes: 4 additions & 4 deletions src/core_plugins/console/api_server/es_5_0/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ export default function (api) {
"routing": "",
"parent": "",
"_source": "",
"_source_exclude": "",
"_source_include": ""
"_source_excludes": "",
"_source_includes": ""
}
});
api.addEndpointDescription('_get_doc_source', {
Expand All @@ -22,8 +22,8 @@ export default function (api) {
"version": 1,
"routing": "",
"parent": "",
"_source_exclude": "",
"_source_include": ""
"_source_excludes": "",
"_source_includes": ""
}
});
api.addEndpointDescription('_delete_doc', {
Expand Down
13 changes: 13 additions & 0 deletions src/core_plugins/console/api_server/es_5_0/indices.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,19 @@ export default function (api) {
}
});


api.addEndpointDescription('_rollover', {
methods: ['POST'],
patterns: [
"{name}/_rollover",
"{name}/_rollover/{name}"
],
url_params: {
wait_for_active_shards: "",
dry_run: "__flag__"
}
});

api.addEndpointDescription('_flush_synced', {
methods: ['POST'],
patterns: [
Expand Down
7 changes: 2 additions & 5 deletions src/core_plugins/console/api_server/es_5_0/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ export default function (api) {
'max_expansions': 10,
'analyzer': '',
'fuzziness': 1.0,
'prefix_length': 1
'prefix_length': 1,
'minimum_should_match': 1
}
},
match_phrase: {
Expand Down Expand Up @@ -287,9 +288,6 @@ export default function (api) {
allow_leading_wildcard: {
__one_of: [true, false]
},
lowercase_expanded_terms: {
__one_of: [true, false]
},
enable_position_increments: {
__one_of: [true, false]
},
Expand Down Expand Up @@ -324,7 +322,6 @@ export default function (api) {
default_operator: { __one_of: ["OR", "AND"] },
analyzer: "",
flags: "OR|AND|PREFIX",
lowercase_expanded_terms: { __one_of: [true, false] },
locale: "ROOT",
lenient: { __one_of: [true, false] }
},
Expand Down
9 changes: 4 additions & 5 deletions src/core_plugins/console/api_server/es_5_0/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ export default function (api) {
default_operator: ["AND", "OR"],
explain: "__flag__",
_source: "",
_source_include: "",
_source_exclude: "",
_source_includes: "",
_source_excludes: "",
stored_fields: [],
sort: "",
track_scores: "__flag__",
Expand All @@ -24,7 +24,6 @@ export default function (api) {
size: 10,
search_type: ["dfs_query_then_fetch", "dfs_query_and_fetch", "query_then_fetch", "query_and_fetch"],
terminate_after: 10,
lowercase_expanded_terms: ["true", "false"],
analyze_wildcard: "__flag__",
preference: ["_primary", "_primary_first", "_local", "_only_node:xyz", "_prefer_node:xyz", "_shards:2,3"],
scroll: "5m",
Expand Down Expand Up @@ -153,13 +152,13 @@ export default function (api) {
"{field}",
["{field}"],
{
"include": {
"includes": {
__one_of: [
"{field}",
["{field}"]
]
},
"exclude": {
"excludes": {
__one_of: [
"{field}",
["{field}"]
Expand Down

0 comments on commit 4665144

Please sign in to comment.