Skip to content

apiVersion - Can not found Elastic version 5.0 #1

Closed
@jpabbuehl

Description

@jpabbuehl

Hi

I am trying to use this module with my local ES cluster (5.0)
I get this error with your example:

/home/jp/react-projects/home_server/node_modules/graphql-compose-elasticsearch/lib/ElasticApiParser.js:317
  throw new Error(`Can not found Elastic version '${version}' in ${apiListFile}`);

Error: Can not found Elastic version '5.0' in /home/jp/react-projects/home_server/node_modules/elasticsearch/src/lib/apis/index.js

at this line

In composeWithElastic({

  elasticClient: new elasticsearch.Client({host: 'http://localhost:9200', apiVersion: '5.0', log: 'trace'})
});

Instead when I use directly the elasticsearch module and the following example, it works.

import elasticsearch from 'elasticsearch';
var client = new elasticsearch.Client({
  host: 'localhost:9200',
  apiVersion: '5.0',
  log: 'trace'
});

client.ping({
  requestTimeout: 30000,
}, function (error) {
  if (error) {
  console.error('elasticsearch cluster is down!');
  } else {
  console.log('All is well');
  }
});

Is there anything wrong with ElasticApiParser.js in your module (probably not :) ?
What I am doing wrong ? BTW I am under ubuntu 16.10
Best

JP

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions