Skip to content

Added the ability to specify an analyzer in the Test Analyzer action #148

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions dist/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -2974,9 +2974,28 @@
}).open();
},
_testAnalyser_handler: function(index) {
this.cluster.get(index.name + "/_analyze?text=" + prompt( i18n.text("IndexCommand.TextToAnalyze") ), function(r) {
alert(JSON.stringify(r, true, " "));
var fields = new app.ux.FieldCollection({
fields: [
new ui.TextField({ label: i18n.text("TestAnalyzerForm.Analyzer"), name: "analyzer", require: false}),
new ui.TextField({ label: i18n.text("TestAnalyzerForm.Text"), name: "text", require: true})
]
});
var dialog = new ui.DialogPanel({
title: i18n.text("TestAnalyzerForm.Title"),
body: new ui.PanelForm({ fields: fields }),
onCommit: function( panel, args ) {
if (fields.validate()) {
var data = fields.getData();
var params = "text=" + data["text"];
if (data["analyzer"]) {
params += "&analyzer=" + data["analyzer"];
}
this.cluster.get(index.name + "/_analyze?" + params, function(r) {
alert(JSON.stringify(r, true, " "));
});
}
}.bind(this)
}).open();
},
_deleteIndexAction_handler: function(index) {
if( prompt( i18n.text("AliasForm.DeleteAliasMessage", i18n.text("Command.DELETE"), index.name ) ) === i18n.text("Command.DELETE") ) {
Expand Down
5 changes: 4 additions & 1 deletion dist/lang/en_strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ i18n.setKeys({
"IndexActionsMenu.Flush": "Flush",
"IndexActionsMenu.Optimize": "Optimize...",
"IndexActionsMenu.Snapshot": "Gateway Snapshot",
"IndexActionsMenu.Analyser": "Test Analyser",
"IndexActionsMenu.Analyser": "Test Analyzer",
"IndexActionsMenu.Open": "Open",
"IndexActionsMenu.Close": "Close",
"IndexActionsMenu.Delete": "Delete...",
Expand Down Expand Up @@ -94,6 +94,9 @@ i18n.setKeys({
"Output.CSV": "CSV",
"Output.ShowSource": "Show query source",
"TableResults.Summary": "Searched {0} of {1} shards. {2} hits. {3} seconds",
"TestAnalyzerForm.Title": "Test Analyzer",
"TestAnalyzerForm.Analyzer": "Analyzer",
"TestAnalyzerForm.Text": "Text",
"QueryFilter.AllIndices": "All Indices",
"QueryFilter.AnyValue": "any",
"QueryFilter-Header-Indices": "Indices",
Expand Down
3 changes: 3 additions & 0 deletions dist/lang/fr_strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ i18n.setKeys({
"Output.Table": "Tableau",
"Output.ShowSource": "Voir la requête source",
"TableResults.Summary": "Recherche sur {0} des {1} shards. {2} résultats. {3} secondes",
"TestAnalyzerForm.Title": "Tester un analyseur",
"TestAnalyzerForm.Analyzer": "Analyseur",
"TestAnalyzerForm.Text": "Texte",
"QueryFilter.AllIndices": "Tous les index",
"QueryFilter.AnyValue": "Tout",
"QueryFilter-Header-Indices": "Index",
Expand Down
3 changes: 3 additions & 0 deletions dist/lang/pt_strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ i18n.setKeys({
"Output.CSV": "CSV",
"Output.ShowSource": "Mostrar consulta original",
"TableResults.Summary": "Buscado {0} de {1} shards. {2} resultados. {3} segundos",
"TestAnalyzerForm.Title": "Analizador de teste",
"TestAnalyzerForm.Analyzer": "Analizador",
"TestAnalyzerForm.Text": "Texto",
"QueryFilter.AllIndices": "Todos os Índices",
"QueryFilter.AnyValue": "qualquer",
"QueryFilter-Header-Indices": "Índices",
Expand Down
5 changes: 4 additions & 1 deletion src/app/lang/en_strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ i18n.setKeys({
"IndexActionsMenu.Flush": "Flush",
"IndexActionsMenu.Optimize": "Optimize...",
"IndexActionsMenu.Snapshot": "Gateway Snapshot",
"IndexActionsMenu.Analyser": "Test Analyser",
"IndexActionsMenu.Analyser": "Test Analyzer",
"IndexActionsMenu.Open": "Open",
"IndexActionsMenu.Close": "Close",
"IndexActionsMenu.Delete": "Delete...",
Expand Down Expand Up @@ -94,6 +94,9 @@ i18n.setKeys({
"Output.CSV": "CSV",
"Output.ShowSource": "Show query source",
"TableResults.Summary": "Searched {0} of {1} shards. {2} hits. {3} seconds",
"TestAnalyzerForm.Title": "Test Analyzer",
"TestAnalyzerForm.Analyzer": "Analyzer",
"TestAnalyzerForm.Text": "Text",
"QueryFilter.AllIndices": "All Indices",
"QueryFilter.AnyValue": "any",
"QueryFilter-Header-Indices": "Indices",
Expand Down
3 changes: 3 additions & 0 deletions src/app/lang/fr_strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ i18n.setKeys({
"Output.Table": "Tableau",
"Output.ShowSource": "Voir la requête source",
"TableResults.Summary": "Recherche sur {0} des {1} shards. {2} résultats. {3} secondes",
"TestAnalyzerForm.Title": "Tester un analyseur",
"TestAnalyzerForm.Analyzer": "Analyseur",
"TestAnalyzerForm.Text": "Texte",
"QueryFilter.AllIndices": "Tous les index",
"QueryFilter.AnyValue": "Tout",
"QueryFilter-Header-Indices": "Index",
Expand Down
3 changes: 3 additions & 0 deletions src/app/lang/pt_strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ i18n.setKeys({
"Output.CSV": "CSV",
"Output.ShowSource": "Mostrar consulta original",
"TableResults.Summary": "Buscado {0} de {1} shards. {2} resultados. {3} segundos",
"TestAnalyzerForm.Title": "Analizador de teste",
"TestAnalyzerForm.Analyzer": "Analizador",
"TestAnalyzerForm.Text": "Texto",
"QueryFilter.AllIndices": "Todos os Índices",
"QueryFilter.AnyValue": "qualquer",
"QueryFilter-Header-Indices": "Índices",
Expand Down
23 changes: 21 additions & 2 deletions src/app/ui/nodesView/nodesView.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,28 @@
}).open();
},
_testAnalyser_handler: function(index) {
this.cluster.get(index.name + "/_analyze?text=" + prompt( i18n.text("IndexCommand.TextToAnalyze") ), function(r) {
alert(JSON.stringify(r, true, " "));
var fields = new app.ux.FieldCollection({
fields: [
new ui.TextField({ label: i18n.text("TestAnalyzerForm.Analyzer"), name: "analyzer", require: false}),
new ui.TextField({ label: i18n.text("TestAnalyzerForm.Text"), name: "text", require: true})
]
});
var dialog = new ui.DialogPanel({
title: i18n.text("TestAnalyzerForm.Title"),
body: new ui.PanelForm({ fields: fields }),
onCommit: function( panel, args ) {
if (fields.validate()) {
var data = fields.getData();
var params = "text=" + data["text"];
if (data["analyzer"]) {
params += "&analyzer=" + data["analyzer"];
}
this.cluster.get(index.name + "/_analyze?" + params, function(r) {
alert(JSON.stringify(r, true, " "));
});
}
}.bind(this)
}).open();
},
_deleteIndexAction_handler: function(index) {
if( prompt( i18n.text("AliasForm.DeleteAliasMessage", i18n.text("Command.DELETE"), index.name ) ) === i18n.text("Command.DELETE") ) {
Expand Down