-
Notifications
You must be signed in to change notification settings - Fork 0
Elasticsearch
To use elastic search on client side we have to sent Ajax request to crossDomain request to elastic search URL. localhost:9200 for localhost.
It give following error.
XMLHttpRequest cannot load http://localhost:9200/. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. This error is with elasticsearch when I try to send cross domain Ajax request.
To solve this we have to enable cors in elasticsearch.yml .
elasticsearch.yml is in /config/elasticsearch.yml do following changes in this file.
http.cors.enabled : truehttp.cors.allow-origin : "*"http.cors.allow-methods : OPTIONS, HEAD, GET, POST, PUT, DELETEhttp.cors.allow-headers : X-Requested-With,X-Auth-Token,Content-Type, Content-Length
we can also use jsonp request method to ride over this error.To allow jsonp request to elasticsearch
http.jsonp.enable: true
TIP
aws dynamodb scan --table-name TABLE_NAME > export.json // export JSON file from dynamo
export NODE_OPTIONS=--max_old_space_size=8172 // Fix JS out of memory