Skip to content

Instantly share code, notes, and snippets.

View dadoonet's full-sized avatar
🇪🇺
From Europe with ❤️

David Pilato dadoonet

🇪🇺
From Europe with ❤️
View GitHub Profile
@dadoonet
dadoonet / README.md
Created February 4, 2014 13:24
Azure on windows

Create a certificate:

"C:\Program Files (x86)\Windows Kits\8.1\bin\x86\makecert.exe" -sky exchange -r -n "CN=ESCert" -pe -a sha1 -len 2048 -ss My "ESCert.cer"

Upload the .cer to the settings management section in the Azure portal.

Using certmgr.msc, export the certificate in .pfx format (it will be in the Personal section). Give it a password with reasonable complexity.

@dadoonet
dadoonet / elasticsearch-azure.yml
Created February 5, 2014 08:15
elasticsearch yaml example for azure plugin
cloud:
azure:
keystore: FULLPATH-TO-YOUR-KEYSTORE
password: YOUR-PASSWORD
subscription_id: YOUR-AZURE-SUBSCRIPTION-ID
service_name: YOUR-AZURE-SERVICE-NAME
discovery:
type: azure
# 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" : {
@dadoonet
dadoonet / test.sh
Created May 27, 2014 16:07
Using git bisect to find origin of an issue
#!/usr/bin/env bash
# To use this script, copy and paste it in elasticsearch git root dir
# launch
# git bisect start {bad revision} {good revision}
# git bisect run ./test.sh
echo " -> starting a new test"
echo "$(git show --quiet)"
@dadoonet
dadoonet / aggs-not-analyzed.sense
Created July 3, 2014 17:52
Compute terms agg on non analyzed terms.
DELETE test
PUT test
{
"mappings": {
"test": {
"properties": {
"deviceId": {
"type": "string",
"index": "not_analyzed"
},
DELETE /check
PUT /check
PUT /check/_mapping/session
{
"session": {
"properties": {
"SessionAtt": {
"type": "attachment",
"store": "yes",
"fields": {
@dadoonet
dadoonet / test_date_millis.json
Created July 8, 2014 15:15
Test date in milliseconds since epoch
DELETE test
PUT test
{
"settings": {
"number_of_shards": 1
},
"mappings": {
"doc": {
"properties": {
"mydate": {
#!/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" : {
@dadoonet
dadoonet / script.sense
Created December 4, 2014 19:57
Example computing duration with aggs
DELETE myindex
PUT myindex
POST /myindex/travel/_mapping
{
"travel": {
"properties": {
"end_date": {
"format": "dateOptionalTime",
"type": "date"
},
@dadoonet
dadoonet / 8823-demo.sh
Last active August 29, 2015 14:11 — forked from grantr/8823-demo.sh
#!/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