Skip to content
This repository was archived by the owner on Mar 5, 2021. It is now read-only.

Commit 29fb0a7

Browse files
author
Leonardo Menezes
committed
using http post for analyze api
1 parent 607cd31 commit 29fb0a7

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

dist/kopf.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ function ElasticClient(connection, http_service, q) {
492492
});
493493
callback_success(tokens);
494494
};
495-
this.executeClusterRequest('GET', "/" + index + "/_analyze?field=" + type +"."+field,{'text':text}, buildTokens, callback_error);
495+
this.executeClusterRequest('POST', "/" + index + "/_analyze?field=" + type +"."+field,{'text':text}, buildTokens, callback_error);
496496
};
497497

498498
this.analyzeByAnalyzer=function(index, analyzer, text, callback_success, callback_error) {
@@ -502,7 +502,7 @@ function ElasticClient(connection, http_service, q) {
502502
});
503503
callback_success(tokens);
504504
};
505-
this.executeClusterRequest('GET', "/" + index + "/_analyze?analyzer=" + analyzer,{'text':text}, buildTokens, callback_error);
505+
this.executeClusterRequest('POST', "/" + index + "/_analyze?analyzer=" + analyzer,{'text':text}, buildTokens, callback_error);
506506
};
507507

508508
this.updateAliases=function(add_aliases,remove_aliases, callback_success, callback_error) {

src/kopf/elastic/elastic_client.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@ function ElasticClient(connection, http_service, q) {
127127
});
128128
callback_success(tokens);
129129
};
130-
this.executeClusterRequest('GET', "/" + index + "/_analyze?field=" + type +"."+field,{'text':text}, buildTokens, callback_error);
130+
console.log(text);
131+
this.executeClusterRequest('POST', "/" + index + "/_analyze?field=" + type +"."+field,{'text':text}, buildTokens, callback_error);
131132
};
132133

133134
this.analyzeByAnalyzer=function(index, analyzer, text, callback_success, callback_error) {
@@ -137,7 +138,7 @@ function ElasticClient(connection, http_service, q) {
137138
});
138139
callback_success(tokens);
139140
};
140-
this.executeClusterRequest('GET', "/" + index + "/_analyze?analyzer=" + analyzer,{'text':text}, buildTokens, callback_error);
141+
this.executeClusterRequest('POST', "/" + index + "/_analyze?analyzer=" + analyzer,{'text':text}, buildTokens, callback_error);
141142
};
142143

143144
this.updateAliases=function(add_aliases,remove_aliases, callback_success, callback_error) {

0 commit comments

Comments
 (0)