Posts

Showing posts with the label Elasticsearch

AWS Elasticsearch Service IAM Role Based Access Policy

Answer : When using IAM service with AWS, you must sign your requests. curl doesn't support signed requests (which consists of hashing the request and adding a parameter to the header of the request). You can use one of their SDK's that has the signing algorithm built in, and then submit that request. See: http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/what-is-amazon-elasticsearch-service.html#signing-requests You can find the SDKs for popular languages here: http://aws.amazon.com/tools/ First, you said you can't login to an EC2 instance to curl the ES instance? You can't login? Or you can't curl it from EC2? I have my Elasticsearch (Service) instance open to the world (with nothing on it) and am able to curl it just fine, without signing. I changed the access policy to test, but unfortunately it takes forever to come back up after changing it... My policy looks like this: { "Version": "2012-10-17", ...

Best Way To Check If A Field Exist In An Elasticsearch Document

Answer : You can use the exists filter combined with a bool/must filter like this: { "query": { "filtered": { "filter": { "bool": { "must": [ { "exists": { "field": "price" } }, ... <-- your other constraints, if any ] } } } } } DEPRECATED (since ES5) You can also use the missing filter combined with a bool/must_not filter: { "query": { "filtered": { "filter": { "bool": { "must_not": [ { "missing": { "field": "price" } } ] } } } } } The exists filter has been replaced by exists query from ES 2.1, though the working of it is the same. Also, t...

Can Not Start Elasticsearch As A Service In Ubuntu 16.04

Answer : I found the solution for this issue. The solution comes from this discussion thread- Can’t start elasticsearch with Ubuntu 16.04 on elastic's website. It seems that to get Elasticsearch to run on 16.04 you have to set START_DAEMON to true on /etc/default/elasticsearch . It comes commented out by default, and uncommenting it makes Elasticsearch start again just fine. Be sure to use systemctl restart instead of just start because the service is started right after installation, and apparently there's some socket/pidfile/something that systemd keeps that must be released before being able to start the service again. The problem lies on log files, "No java runtime was found." Jul 30 18:28:13 dimik elasticsearch[10266]: [warning] /etc/init.d/elasticsearch: No java runtime was found Here's my solution to the problem. Check elasticsearch init file sudo nano /etc/init.d/elasticsearch search for . /usr/share/java-w...