Skip to content
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

TypeError: esearch.searchExists is not a function #23

Open
alexanderjsx opened this issue Dec 27, 2016 · 5 comments
Open

TypeError: esearch.searchExists is not a function #23

alexanderjsx opened this issue Dec 27, 2016 · 5 comments

Comments

@alexanderjsx
Copy link

alexanderjsx commented Dec 27, 2016

Getting Type error on fresh installation:

    at Object.monitor (/Users/ajakoba/KWIFF_REPOS/core/core-logging/node_modules/appmetrics-elk/lib/appmetrics-elk.js:70:13)
    at Object.<anonymous> (/Users/ajakoba/KWIFF_REPOS/core/core-logging/index.js:2:27)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Function.Module.runMain (module.js:441:10)
    at startup (node.js:139:18)
    at node.js:974:3

elasticsearch node module version installed with the library is 12.1.3
elasticsearch server version 5.1.1
node version v4.6.1

@seabaylea
Copy link
Member

It looks like the searchExists() API was removed in the easticsearch.js 5.0 API update.

As a workaround, you should be able to request the 2.4 API using the apiVersion field in the Elasticsearch config object you pass to the monitor() API of appmetrics-elk, eg.

var config = {
    apiVersion = '2.4'
}
var appmetrics = require('appmetrics-elk').monitor(config); 

@arjanvanderleden
Copy link

Solution of @seabaylea works for me

@imvishalsingh
Copy link

[Mon Aug 21 18:08:45 2017] com.ibm.diagnostics.healthcenter.loader INFO: Node Application Metrics 1.2.0.201612012154 (Agent Core 3.1.0)
[Mon Aug 21 18:08:45 2017] com.ibm.diagnostics.healthcenter.mqtt INFO: Connecting to broker localhost:1883
/project/academic/node_modules/appmetrics-elk/lib/appmetrics-elk.js:70
esearch.searchExists({
^

TypeError: esearch.searchExists is not a function
at Object.monitor (/project/academic/node_modules/appmetrics-elk/lib/appmetrics-elk.js:70:13)
at Object. (/project/academic/app.js:31:44)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.runMain (module.js:604:10)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:149:9)

node -version: 6.10
elastic server -varsion: 5.5

I try above api version but it not working, help me

@imvishalsingh
Copy link

imvishalsingh commented Aug 21, 2017

var config = {
host: 'http://172.28.49.13:9200',
apiVersion: 2.4
}
var appmetrics = require('appmetrics-elk').monitor();
appmetrics.disable('mysql'); // disable MySQL monitoring

@ggb667
Copy link

ggb667 commented Jan 8, 2018

I updated package.json to:
"appmetrics": "^3.0.0",
"elasticsearch": "13.3.1"

This work around no longer works apparently. Maybe apiVersion can't go back that far? Any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants