Skip to content

Commit

Permalink
fixed an issue with $INDEX$ autocomplete
Browse files Browse the repository at this point in the history
  • Loading branch information
bleskes committed Apr 8, 2013
1 parent e1810c8 commit 2a310dc
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 4 deletions.
2 changes: 1 addition & 1 deletion kb/aliases.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ sense.kb.addEndpointDescription('_aliases', {
__any_of: [
{
add: {
index: "",
index: "$INDEX$",
alias: "",
filter: {},
routing: "1",
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

"name": "Sense (beta)",
"description": "A JSON aware developer console to ElasticSearch.",
"version": "0.5.0",
"version": "0.5.1",

"icons": {
"16": "icons/logo16.png",
Expand Down
3 changes: 1 addition & 2 deletions src/autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,7 @@
if (rules) {
if (typeof rules == "string") {
if (rules == "$INDEX$") {
if (ACTIVE_INDICES)
$.merge(autocompleteSet.completionTerms, ACTIVE_INDICES);
$.merge(autocompleteSet.completionTerms, global.sense.mappings.getIndices());
}
else if (rules == "$FIELD$") {
$.merge(autocompleteSet.completionTerms,
Expand Down
23 changes: 23 additions & 0 deletions tests/src/integration_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,29 @@ context_tests(
]
);

context_tests(
{
"index": "123"
},
MAPPING,
{
endpoints: {
_test: {
data_autocomplete_rules: {
index: "$INDEX$"
}
}}
},
"_test",
[
{
name: "$INDEX$ matching",
cursor: { row: 1, column: 15},
autoCompleteSet: { completionTerms: ["index1", "index2"] }
}
]
);

context_tests(
{
"array": [
Expand Down

0 comments on commit 2a310dc

Please sign in to comment.