This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Start the first node and keep the generated security credentials handy | |
docker run -e ES_JAVA_OPTS="-Xms1g -Xmx1g" -p 9200:9200 -it docker.elastic.co/elasticsearch/elasticsearch:8.0.0 | |
// Check if the node has started correctly | |
curl --insecure --user elastic https://localhost:9200/ | |
// Add your second node | |
docker run -e ENROLLMENT_TOKEN="..." -e ES_JAVA_OPTS="-Xms1g -Xmx1g" -it docker.elastic.co/elasticsearch/elasticsearch:8.0.0 | |
// Check if it has joined the cluster |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GET /logstash-2015.04.30/_search | |
{ | |
"query": { | |
"filtered": { | |
"filter": { | |
"bool": { | |
"must": [ | |
{ | |
"term": { | |
"type": "iis6" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
pkill -f 'elasticsearch.*cluster.name=8823' | |
rm -rf data/8823 | |
bin/elasticsearch -Des.node.master=true -Des.cluster.name=8823 -Des.node.name=master 2>&1 >/dev/null & | |
sleep 1 | |
bin/elasticsearch -Des.node.master=false -Des.cluster.name=8823 -Des.node.name=data1 2>&1 >/dev/null & | |
sleep 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
echo "\n Delete old index" | |
curl -X DELETE 'http://localhost:9200/bands' | |
echo "\n Create Index Mapping" | |
curl -X POST 'http://localhost:9200/bands/' -d '{ | |
"mappings" : { | |
"documents" : { | |
"properties" : { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Delete index | |
curl -s -X DELETE "http://$host:$port/multi_field_facetting" 2>&1 > /dev/null | |
# Create index | |
curl -s -X POST "http://$host:$port/multi_field_facetting" -d ' | |
{ | |
"settings" : { | |
"index": { | |
"analysis" : { | |
"filter" : { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -XDELETE 'http://localhost:9200/logstash-2013.12.20/'; echo | |
curl -XPOST 'http://localhost:9200/logstash-2013.12.20/cloudtest' -d ' | |
{ | |
"responseElements": { | |
"instancesSet": { | |
"items": [ | |
{ | |
"instanceId": "i-1bbb1111", | |
"currentState": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -XDELETE "http://localhost:9200/test"; echo | |
curl -XPUT "http://localhost:9200/test" -d' | |
{ | |
"settings": { | |
"index": { | |
"number_of_shards": 1, | |
"number_of_replicas": 0 | |
}, | |
"analysis": { | |
"analyzer": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "Deleting old ElasticSearch index..." | |
curl -XDELETE 'localhost:9200/arrtest'; echo | |
echo "Creating new ElasticSearch index..." | |
curl -XPUT 'localhost:9200/arrtest/?pretty=1' -d ' | |
{ | |
"mappings" : { | |
"cust2" : { | |
"properties" : { | |
"firstName" : { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -XPUT http://localhost:9200/test/ticket/_mappinq? -d '{ | |
"ticket" : { | |
"properties" : { | |
"DOC_CREATION_DATE" : { | |
"type" : "date", | |
"format" : "yyyy-MM-dd || yyyy-MM-dd HH:mm:ss", | |
"locale" : "FR" | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// app.js | |
angular.module('cs_demo', [ | |
'controllers', | |
'elasticjs.service', | |
'ui.bootstrap' | |
]); |
NewerOlder