This file contains hidden or 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
################################### | |
## Introduction to Elasticsearch ## | |
################################### | |
######################### | |
## If you do not want to run Elasticsearch yourself | |
## Test a free 14 day trial at | |
## https://www.elastic.co/cloud/ | |
######################### |
This file contains hidden or 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 back_in_stock_notifications | |
DELETE test | |
PUT test/_bulk?refresh | |
{ "index" : { "_id" : "1"}} | |
{ "id": "1", "title" : "T-Shirt", "size" : "XL", "color": "red", "stock" : 0 } | |
{ "index" : { "_id" : 2}} | |
{ "id": "2", "title" : "T-Shirt", "size" : "XL", "color": "green", "stock" : 1 } | |
{ "index" : { "_id" : 3}} | |
{ "id": "3", "title" : "T-Shirt", "size" : "XL", "color": "yellow", "stock" : 2 } |
This file contains hidden or 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
crystal eval 'port = 8080 ; require "http/server"; server = HTTP::Server.new do |ctx| req = ctx.request; req.to_io STDOUT ; STDOUT.print "\n\n" if req.body end ; server.listen 8080' |
This file contains hidden or 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
POST _ingest/pipeline/_simulate?filter_path=**.predicted_value | |
{ | |
"pipeline": { | |
"processors": [ | |
{ | |
"inference": { | |
"model_id": "lang_ident_model_1", | |
"inference_config": { "classification": {}}, | |
"field_mappings": {} | |
} |
This file contains hidden or 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
# Data is from https://www.sciencedirect.com/science/article/pii/S2352340918315191 | |
filebeat.inputs: | |
- type: stdin | |
setup.template.overwrite: true | |
setup.template.append_fields: | |
- name: arrival_date | |
type: date |
This file contains hidden or 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
# date_range datatype | |
PUT range_index | |
{ | |
"mappings": { | |
"properties": { | |
"time_frame": { "type": "date_range" } | |
} | |
} | |
} |
This file contains hidden or 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 -s http://stream.meetup.com/2/rsvps | ./bin/logstash -f logstash-meetup.conf | |
input { | |
stdin { | |
codec => json_lines | |
} | |
} | |
# the lonlat array is needed for the map widget in kibana to work | |
# so we have to work a bit around the supplied data | |
filter { |
This file contains hidden or 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
-- Umlaute without the hassle, hell yeah | |
hs.hotkey.bind({'alt'}, 'u', function () | |
hs.eventtap.keyStrokes('ü') | |
end) | |
hs.hotkey.bind({'shift', 'alt'}, 'u', function () | |
hs.eventtap.keyStrokes('Ü') | |
end) | |
hs.hotkey.bind({'alt'}, 'a', function () |
This file contains hidden or 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
##### decompounder example | |
DELETE decompound | |
PUT decompound | |
{ | |
"settings": { | |
"analysis": { | |
"analyzer": { | |
"my_decompound_analyzer" : { | |
"type" : "custom", |
This file contains hidden or 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 sample | |
PUT sample | |
{ | |
"mappings": { | |
"foo" : { | |
"_source": { "enabled": false }, | |
"properties": { | |
"my_field" : { | |
"type": "text", |