Elastic
curl -XGET ‘35.225.194.174:9200/’
sudo /opt/bitnami/apache2/bin/htpasswd -c /opt/bitnami/elasticsearch/apache-conf/password user
/opt/bitnami/elasticsearch/config/elasticsearch.yml
sudo /opt/bitnami/ctlscript.sh stop elasticsearch
curl -sL https://deb.nodesource.com/setup_11.x | bash -
apt-get install -y nodejs
wget https://github.com/mobz/elasticsearch-head/archive/master.zip
unzip master.zip
cd elasticsearch-head-master
npm install
./node_modules/grunt/bin/grunt server &
vi /opt/bitnami/elasticsearch/config/elasticsearch.yml
http.cors.enabled: true
http.cors.allow-origin: /https?:\/\/localhost(:[0-9]+)?/
vi /opt/bitnami/elasticsearch/apache-conf/elasticsearch.conf
ProxyPass /elasticsearch-head http://127.0.0.1:9100
ProxyPassReverse /elasticsearch-head http://127.0.0.1:9100
sudo /opt/bitnami/ctlscript.sh restart apache
http://35.225.194.174/elasticsearch-head/?base_uri=http://35.225.194.174/elasticsearch
apt-get install ufw
ufw enable
ufw default deny incoming
ufw default allow outgoing
ufw allow ssh
// your ip
ufw allow from 218.215.134.75/32 to any port 80
ufw allow 80
GET /user/_analyze?analyzer=email
{
"text": "david.klenowski@gmail.com"
}
GET /user/_search
{
"query": { "match_all": {} }
}
GET /user/_search
{
"query": {
"term": {
"email": "eddie.vedder@gmail.com"
}
}
}
PUT /location
{
"index": {
"number_of_shards": 1,
"number_of_replicas": 1
},
"mappings": {
"location": {
"properties": {
"suggest": {
"type": "completion"
},
"loc" : {
"type": "keyword"
}
}
}
}
}
PUT location/location/1?refresh
{
"suggest" : {
"input": "Sydney, NSW, Australia",
"weight" : 50000
}
}
POST /location/_search
{
"suggest": {
"location-suggest" : {
"prefix" : "s",
"completion" : {
"field" : "suggest"
}
}
}
}