File tree Expand file tree Collapse file tree 4 files changed +28
-6
lines changed Expand file tree Collapse file tree 4 files changed +28
-6
lines changed Original file line number Diff line number Diff line change 3151
3151
} ) . open ( ) ;
3152
3152
} ,
3153
3153
_testAnalyser_handler : function ( index ) {
3154
- this . cluster . get ( encodeURIComponent ( index . name ) + "/_analyze?text=" + encodeURIComponent ( prompt ( i18n . text ( "IndexCommand.TextToAnalyze" ) ) ) , function ( r ) {
3155
- alert ( JSON . stringify ( r , true , " " ) ) ;
3156
- } ) ;
3154
+ if ( this . cluster . _version_parts [ 0 ] <= 5 ) {
3155
+ this . cluster . get ( encodeURIComponent ( index . name ) + "/_analyze?text=" + encodeURIComponent ( prompt ( i18n . text ( "IndexCommand.TextToAnalyze" ) ) ) , function ( r ) {
3156
+ new ui . JsonPanel ( { json : r , title : "" } ) ;
3157
+ } ) ;
3158
+ } else {
3159
+ var command = {
3160
+ "analyzer" : prompt ( i18n . text ( "IndexCommand.AnalyzerToUse" ) ) ,
3161
+ "text" : prompt ( i18n . text ( "IndexCommand.TextToAnalyze" ) )
3162
+ } ;
3163
+ this . cluster . post ( encodeURIComponent ( index . name ) + "/_analyze" , JSON . stringify ( command ) , function ( r ) {
3164
+ new ui . JsonPanel ( { json : r , title : "" } ) ;
3165
+ } ) ;
3166
+ }
3157
3167
} ,
3158
3168
_deleteIndexAction_handler : function ( index ) {
3159
3169
if ( prompt ( i18n . text ( "AliasForm.DeleteAliasMessage" , i18n . text ( "Command.DELETE" ) , index . name ) ) === i18n . text ( "Command.DELETE" ) ) {
Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ i18n.setKeys({
51
51
"IndexInfoMenu.Status" : "Index Status" ,
52
52
"IndexInfoMenu.Metadata" : "Index Metadata" ,
53
53
"IndexCommand.TextToAnalyze" : "Text to Analyse" ,
54
+ "IndexCommand.AnalyzerToUse" : "Name of Analyzer (built-in or customized)" ,
54
55
"IndexCommand.ShutdownMessage" : "type ''{0}'' to shutdown {1}. Node can NOT be restarted from this interface" ,
55
56
"IndexOverview.PageTitle" : "Indices Overview" ,
56
57
"IndexSelector.NameWithDocs" : "{0} ({1} docs)" ,
Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ i18n.setKeys({
51
51
"IndexInfoMenu.Status" : "Index Status" ,
52
52
"IndexInfoMenu.Metadata" : "Index Metadata" ,
53
53
"IndexCommand.TextToAnalyze" : "Text to Analyse" ,
54
+ "IndexCommand.AnalyzerToUse" : "Name of Analyzer (built-in or customized)" ,
54
55
"IndexCommand.ShutdownMessage" : "type ''{0}'' to shutdown {1}. Node can NOT be restarted from this interface" ,
55
56
"IndexOverview.PageTitle" : "Indices Overview" ,
56
57
"IndexSelector.NameWithDocs" : "{0} ({1} docs)" ,
Original file line number Diff line number Diff line change 101
101
} ) . open ( ) ;
102
102
} ,
103
103
_testAnalyser_handler : function ( index ) {
104
- this . cluster . get ( encodeURIComponent ( index . name ) + "/_analyze?text=" + encodeURIComponent ( prompt ( i18n . text ( "IndexCommand.TextToAnalyze" ) ) ) , function ( r ) {
105
- alert ( JSON . stringify ( r , true , " " ) ) ;
106
- } ) ;
104
+ if ( this . cluster . _version_parts [ 0 ] <= 5 ) {
105
+ this . cluster . get ( encodeURIComponent ( index . name ) + "/_analyze?text=" + encodeURIComponent ( prompt ( i18n . text ( "IndexCommand.TextToAnalyze" ) ) ) , function ( r ) {
106
+ new ui . JsonPanel ( { json : r , title : "" } ) ;
107
+ } ) ;
108
+ } else {
109
+ var command = {
110
+ "analyzer" : prompt ( i18n . text ( "IndexCommand.AnalyzerToUse" ) ) ,
111
+ "text" : prompt ( i18n . text ( "IndexCommand.TextToAnalyze" ) )
112
+ } ;
113
+ this . cluster . post ( encodeURIComponent ( index . name ) + "/_analyze" , JSON . stringify ( command ) , function ( r ) {
114
+ new ui . JsonPanel ( { json : r , title : "" } ) ;
115
+ } ) ;
116
+ }
107
117
} ,
108
118
_deleteIndexAction_handler : function ( index ) {
109
119
if ( prompt ( i18n . text ( "AliasForm.DeleteAliasMessage" , i18n . text ( "Command.DELETE" ) , index . name ) ) === i18n . text ( "Command.DELETE" ) ) {
You can’t perform that action at this time.
0 commit comments