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 / 01-script-ingest.txt
Created June 22, 2016 10:22
Notes for the Ingest Node demo
# 52.35.38.35 - - [19/Apr/2016:12:00:04 +0200] "GET / HTTP/1.1" 200 24
# Start with empty pipeline
GET _ingest/pipeline/_simulate
{
"pipeline" : {
"processors" : [
]
},
"docs" : [
{
"took" : 62,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 1,
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": {
# Delete the index `testindex`
curl -XDELETE 'http://localhost:9200/test' ; echo
# Create the index `testindex`
curl -XPUT 'http://localhost:9200/test' -d '{
"settings" : {
"index" : {
"number_of_shards" : 1,
"number_of_replicas" : 0
},
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": {
@dadoonet
dadoonet / facet_ip.sh
Created December 5, 2013 07:56
Facet on IP address V4
curl -XPOST http://localhost:9200/foo; echo
curl -XPUT http://localhost:9200/foo/bar/_mapping -d '{
"bar":{
"properties":{
"clientip":{
"type":"multi_field",
"fields":{
"clientip":{
"type":"ip"
@dadoonet
dadoonet / version_actual.sh
Last active December 29, 2015 17:29
Related to issue: https://github.com/elasticsearch/elasticsearch/issues/4300 Version number could appear as inconsistent
curl -XDELETE "http://localhost:9200/myindex"; echo
curl -XPUT "http://localhost:9200/myindex" -d'
{
"settings": {
"gc_deletes": "30s"
}
}'; echo
curl -XPUT "http://localhost:9200/myindex/doc/1" -d'{ "foo" : "bar" }'; echo
curl -XDELETE "http://localhost:9200/myindex/doc/1?version=1"; echo
curl -XPUT "http://localhost:9200/myindex/doc/1?version=2" -d'{ "foo" : "bar" }'; echo
curl -XDELETE "http://localhost:9200/anindex"; echo
curl -XPUT "http://localhost:9200/anindex/atype/1" -d'
{
"obj1":
{
"foo" : "bar"
},
"obj2" :
{
"baz" : "qux"
@dadoonet
dadoonet / script.sh
Created November 28, 2013 10:35
Test doc field existence in elasticsearch facet script
curl -XDELETE "http://localhost:9200/script/"
curl -XPUT "http://localhost:9200/script/doc/1" -d'
{
"title":"test"
}'
curl -XPUT "http://localhost:9200/script/doc/2?refresh" -d'
{
"title":"nothing",
@dadoonet
dadoonet / bluekiwi.sh
Created November 8, 2013 17:21
Bluekiwi example
curl -XDELETE "http://localhost:9200/bluekiwi"; echo
curl -XPUT "http://localhost:9200/bluekiwi/doc/1" -d'
{
"group":1,
"title":"test",
"content":"nothing",
"tags":["tag1","tag2"],
"authorId":1,
"creatorId":1