Skip to content

Instantly share code, notes, and snippets.

View alexbrasetvik's full-sized avatar

Alex Brasetvik alexbrasetvik

View GitHub Profile
_type: district
title: there
---
_type: street
title: there
kol_tags:
scored:
- name: "Core Grower"
score: 36
- name: "Connectivity"
score: 42
---
_type: parent
_id: 1
name: Ned
---
_type: child
_parent: 1
_id: 2
name: Arya
@alexbrasetvik
alexbrasetvik / keybase.md
Created May 26, 2015 16:46
Keybase Proof

Keybase proof

I hereby claim:

  • I am alexbrasetvik on github.
  • I am alexbrasetvik (https://keybase.io/alexbrasetvik) on keybase.
  • I have a public key whose fingerprint is 91D4 8087 9B6E BB65 9828 2A01 3194 684C B1EE EEED

To claim this, I am signing this object:

@alexbrasetvik
alexbrasetvik / ssl-acl.yaml
Created January 28, 2013 10:17
SSL-only-ACL
rules:
- paths: ['.*']
conditions:
- ssl: # Note: nested under "conditions", which is in the same object as "paths" and "action".
require: true
action: allow
@alexbrasetvik
alexbrasetvik / reindex.py
Last active December 12, 2015 04:28
Elasticsearch reindexing/migrating
import json, requests
source_cluster = 'https://abc1234-us-east-1.foundcluster.com:9243'
destination_cluster = 'http://c0ffee-us-east-1.foundcluster.com:9200'
source_session = requests.session()
source_session.auth = ('user', 'pass')
destination_session = requests.session()
destination_session.auth = ('user', 'pass')
@alexbrasetvik
alexbrasetvik / analysis.yaml
Created October 8, 2013 22:08
Using an edgeNGram index analyzer and a simpler search analyzer for partial filename purposes.
# Switch to the Analysis-tab to see how these samples get analyzed.
text:
- My_second_file_created_at_2012.01.13.pdf
- Another file.txt
analyzer:
filename_index:
type: custom
tokenizer: filename
@alexbrasetvik
alexbrasetvik / analysis.yaml
Created November 13, 2013 12:20
Using an edgeNGram index analyzer and a simpler search analyzer for partial filename purposes.
# Switch to the Analysis-tab to see how these samples get analyzed.
text:
- My_second_file_created_at_2012.01.13.pdf
- Another file.txt
analyzer:
filename_index:
type: custom
tokenizer: filename
@alexbrasetvik
alexbrasetvik / analysis.yaml
Created November 14, 2013 10:29
Standard tokenization, but without the lowercasing and stopword removal.
text: This text will be used if nothing else is specified.
analyzer:
standard_tokenize_only:
type: custom
tokenizer: standard
# Switch to the "Analysis"-tab to see how the text gets tokenized by default.
standard:
type: standard
@alexbrasetvik
alexbrasetvik / analysis.yaml
Created November 22, 2013 08:24
Simple example of nested mappings, with queries that require a key to match as well.
# Here you could have various analyzers for different string-types.
# "text_value" and "name_value" should probably have different ones.