Skip to content

Instantly share code, notes, and snippets.

View byronvoorbach's full-sized avatar

Byron Voorbach byronvoorbach

View GitHub Profile
DELETE test
#Create index
PUT test
{
"mappings": {
"test": {
"properties": {
"colour": {
"type": "keyword"
@byronvoorbach
byronvoorbach / field-collapsing.txt
Created February 17, 2017 13:24
Elasticsearch field collapsing example
DELETE shop
PUT shop
{
"settings": {
"number_of_shards": 1,
"number_of_replicas": 0
},
"mappings": {
"product": {
"properties": {
@byronvoorbach
byronvoorbach / anwb-coords-hmpaal
Last active August 29, 2015 14:19
Curl JQ, retrieve all coordinates for HMPalen with certain classification
curl -s -XGET "http://localhost:9200/geo/hmpaal/_search?size=5000" -d' {"query":{"filtered":{"filter":{"term":{"lbiClassificatie":"lbi1"}}}}}' | jq -r '.hits.hits[]._source.locatie | join("/")'
@byronvoorbach
byronvoorbach / gist:a88e0a4a99480dcc46bb
Created April 23, 2015 08:55
Curl JQ, retrieve all coordinates for hectometerpalen en place them in text file
curl -XGET -s "http://localhost:9200/geo/hmpaal/_search?size=10" | jq -r '.hits.hits[]._source.locatie | join("/")' > hectometerpalen.txt
@byronvoorbach
byronvoorbach / basic index setup
Last active August 29, 2015 13:56
ElasticSearch - basic index setup
POST test
{
"settings": {
"number_of_shards": 1,
"number_of_replicas": 0
},
"mappings": {
"text": {
"properties": {
"message": {