-
Notifications
You must be signed in to change notification settings - Fork 127
Open
Description
I am totally shocked why my code in node.js doesnt work and with python works like a charm? It is so weird for me :( Could someone take a look please and tell me what I am doing wrong?
Python code:
from elasticsearch import Elasticsearch
import json
esclient = Elasticsearch(['https://61699**.eu-central-1.aws.cloud.es.io/recipes/'],
http_auth=('d**', 'e.**'), scheme="https")
response = esclient.search(index="", body=json.dumps({"query": {"match": {'Title':'Easter Bunny Cupcakes'}}}))
print response
Node.js code:
const elasticsearch = require('elasticsearch');
const AWS = require('aws-sdk');
const client = elasticsearch.Client({
hosts: ''61699**.eu-central-1.aws.cloud.es.io/recipes/',
connectionClass: require('http-aws-es'),
amazonES: {
accessKey: 'd**',
secretKey: 'e.**',
},
awsConfig: new AWS.Config({region: 'eu-central-1'}),
});
client.index({
index: '',
type: '_doc',
body: {
query: {
match: {
Title: 'Easter Bunny Cupcakes',
},
},
},
}, function(err, data) {
console.log(err);
});
Metadata
Metadata
Assignees
Labels
No labels