Skip to content

Instantly share code, notes, and snippets.

View alexbrasetvik's full-sized avatar

Alex Brasetvik alexbrasetvik

View GitHub Profile
_type: product
store: Apple Store
category: Computers
name: MacBook Pro
---
_type: product
store: Apple Store
# Some sample documents that could be data about ticket sales.
# An organization can have multiple events, and an event has ticket sales.
# Tickets can have different prices, and are of course sold at different times.
ticket_id: 1
event: red_wedding
organization: freys
sold_at: 2013-12-01T12:00
price: 400
---
@alexbrasetvik
alexbrasetvik / documents.yaml
Created December 20, 2013 11:30
Simple examples of aggregations on CPU metrics.
# Sample data points.
# These could e.g. be metrics reported by collectd to logstash.
host: app1
cpu: 87.0
---
host: app1
cpu: 1.23
---
host: app2
text:
- Michael
- Heaney
- Heavey
analyzer:
metaphone:
type: custom
tokenizer: standard
_id: 1
foo: null
bar: null
---
_id: 2
foo: ''
bar: ''
---
_id: 3
foo: bar
@alexbrasetvik
alexbrasetvik / analysis.yaml
Created November 24, 2013 17:00
Demo that "prefix"-query does not analyze the query text.
analyzer:
sample:
text:
- Jon Snow
- Big Ben
tokenizer: standard
type: custom
filter:
- lowercase
@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.
@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 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 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