Open KrishnaPG opened 9 years ago
Hi, was there an answer to this question? I'm getting the same error. Thanks.
@ram-bcll-tech to patch we'd really want a failing test. Is there any way to see if you can get that?
Thank you for your response. I'm new to ES and was trying to follow your tutorial. This may very well be a simple usage issue.
I do have the ES running on a server and I'm able to successfully query and get responses from the server on clients via HTTP.. However, when I try to embed the query in an app in a browser (Chrome Version 53.0.2785.143 (64-bit)), the code (attached) doesn't seem to go past the line, "var elasticsearch = require('elasticsearch');". I placed simple console.log messages immediately before and after this line. I see the preceding comment printed in the console, but, not the following one and there are no other messages, error or otherwise, in the console, so, I'm not able to figure out what the issue is. Thanks for any help you can provide.
App.prototype.getMinorsCount = function() { console.log("starting elasticsearch connection"); var elasticsearch = require('elasticsearch'); console.log("past elasticsearch declaration");
var client = new elasticsearch.Client({
host: 'http://<server_name>.amazonaws.com:9200',
log: 'trace'
});
client.ping({
requestTimeout: 30000,
// undocumented params are appended to the query string
hello: "elasticsearch"
}, function (error) {
if (error) {
console.error('elasticsearch cluster is down!');
} else {
console.log('All is well');
}
});
};
console output:
starting elasticsearch connection
@ram-bcll-tech got you. The thing is without some error output it is tough to debug. Do you see any error messages in the console?
Sorry, i thought I had responded to your last note, but, i don't see it online.
To answer your last question, no, I don't see any error messages. This is what has me stumped as well.
No, unfortunately the only message in the console is the console.log message, immediately preceding "var elasticsearch = require('elasticsearch');" line. The console.log message immediately following the var line is not executed. I do know that nothing else in the function gets executed either as there are other console.log messages in the function that are not executed.
Thanks for your help.
Best regards, Ram
Here's the entire function (stripped down for simplicity):
PTApp.prototype.getMinorsCount = function() { console.log("starting elasticsearch connection"); <== this is printed var elasticsearch = require('elasticsearch'); console.log("past elasticsearch declaration"); <== this is NOT printed
var client = new elasticsearch.Client({
host: 'http://ec2-54-166-167-126.compute-1.amazonaws.com:9200',
log: 'trace'
});
client.ping({
requestTimeout: 30000,
hello: 'elasticsearch'
}, function (error) {
if (error) {
console.error('elasticsearch cluster is down!');
} else {
console.log('All is well');
}
});
console.log("leaving elasticsearch connection"); };
On Thu, Oct 20, 2016 at 8:56 AM, Rufus Pollock notifications@github.com wrote:
@ram-bcll-tech https://github.com/ram-bcll-tech got you. The thing is without some error output it is tough to debug. Do you see any error messages in the console?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/okfn/elasticsearch.js/issues/14#issuecomment-255097846, or mute the thread https://github.com/notifications/unsubscribe-auth/ARrhNAYfuB2w0iBmrIKVdLDsg73IK1JXks5q12T0gaJpZM4DKW-n .
Hello,
Trying to follow your example, but getting 'undefined value' error from
ES.Table()
function. You can try the below sample code and put a break point nere the 'problem here' statement and verify the problem.