Skip to content

Instantly share code, notes, and snippets.

View byronvoorbach's full-sized avatar

Byron Voorbach byronvoorbach

View GitHub Profile
@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": {
@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 / 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 / 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": {
DELETE test
#Create index
PUT test
{
"mappings": {
"test": {
"properties": {
"colour": {
"type": "keyword"
@byronvoorbach
byronvoorbach / collapse.inner_hits.bug.txt
Created May 15, 2017 11:23
ES 5.4 - Field Collapsing + inner hits throws exception
## Example gist, showing a possible bug in inner_hits workings in collapse feature when size > amount of results.
DELETE webshop
#Create some products
POST webshop/product/1
{
"title": "The Division - PS4",
"family_id": 1
}
PUT webshop
{
"settings": {
"number_of_shards": 1,
"number_of_replicas": 0,
"analysis": {
"filter": {
},
"analyzer": {
@byronvoorbach
byronvoorbach / filters.txt
Created October 4, 2017 13:52
(Graphical) Filters
#LEXISNEXIS
DELETE shop
PUT shop
{
"settings": {
"number_of_shards": 1,
"number_of_replicas": 0
},
"mappings": {
@byronvoorbach
byronvoorbach / composite_icm_date_histo
Created December 20, 2017 13:15
Possible bug when using date_histo icm composite aggregation - Elasticsearch 6.1.1
DELETE tickers
PUT tickers
{
"settings": {
"number_of_shards": 1,
"number_of_replicas": 0
},
"mappings": {
"tickers": {
DELETE test
PUT test
{
"settings": {
"number_of_replicas": 0,
"number_of_shards": 1
},
"mappings": {
"test": {
"properties": {