This file contains 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
# Importing and searching RSS with ElasticSearch and Tire | |
# ======================================================= | |
require 'rubygems' | |
require 'tire' | |
require 'nokogiri' | |
require 'open-uri' | |
# First, let's check for a running ElasticSearch server. | |
# |
This file contains 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
# Vagrant is installed | |
# VirtualBox is installed | |
# pwd: ~/Vagrant | |
git clone https://github.com/jedi4ever/veewee.git | |
cd veewee/ | |
bundle install | |
git pull | |
bundle update | |
bundle exec veewee vbox templates |
This file contains 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
var sandbox = {}; | |
require('vm').runInNewContext('x["dot.notated"]', {x: {'dot.notated':'hello'}}); |
This file contains 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 -XPUT localhost:9200/test | |
curl -XPUT localhost:9200/test/mock/_mapping -d '{mock: {properties: {x: {type: "integer"},y: {type: "integer"}}}}' | |
curl -XPUT localhost:9200/test/mock/1 -d '{x:5, y:6}' | |
# Score should be 30 | |
curl 'localhost:9200/test/mock/_search' -d '{query: {function_score: {query: {match_all:{}},functions: [{"script_score": {script: "doc[\"x\"].value * (doc.containsKey(\"y\") ? doc[\"y\"].value : 1)"}}]}}}' | |
# Score should be 5 | |
curl 'localhost:9200/test/mock/_search' -d '{query: {function_score: {query: {match_all:{}},functions: [{"script_score": {script: "doc[\"x\"].value * (doc.containsKey(\"z\") ? doc[\"z\"].value : 1)"}}]}}}' |
This file contains 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
#!/usr/bin/env bash | |
CURRENTDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) | |
hash foo 2>/dev/null || { echo >&2 "I require foo but it's not installed. Aborting."; exit 1; } |
This file contains 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
#!/usr/bin/env bash | |
curl -XDELETE 'localhost:9200/highlightproblem'; echo | |
curl -XPUT 'localhost:9200/highlightproblem'; echo | |
curl -XPUT 'localhost:9200/highlightproblem/highlightproblem/_mapping' -d '{ | |
"highlightproblem": { | |
"properties": { | |
"title": { | |
"type": "string", | |
"term_vector": "with_positions_offsets" |
This file contains 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
#!/usr/bin/env bash | |
curl -XDELETE 'localhost:9200/timeaggregate'; echo | |
curl -XPUT 'localhost:9200/timeaggregate'; echo | |
curl -XPUT 'localhost:9200/timeaggregate/event/_mapping' -d '{ | |
"event": { | |
"properties": { | |
"timestamp": { | |
"type": "date" | |
} |
This file contains 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
#!/usr/bin/env bash | |
set -e | |
CURRENT_DIR_OLD=$(dirname "${BASH_SOURCE[0]}" ) | |
CURRENT_DIR_NEW=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd) | |
echo "$CURRENT_DIR_OLD" | |
echo "$CURRENT_DIR_NEW" |
This file contains 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
#!/usr/bin/env bash | |
curl -XDELETE 'localhost:9200/nowverification'; echo | |
curl -XPUT 'localhost:9200/nowverification'; echo | |
curl -XPUT 'localhost:9200/nowverification/event/_mapping' -d '{ | |
"event": { | |
"properties": { | |
"timestamp": { | |
"type": "date" | |
} |
This file contains 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
#!/usr/bin/env bash | |
curl -XDELETE 'localhost:9200/maptest' | |
curl -XPOST 'localhost:9200/maptest/_refresh?pretty' | |
curl -XPUT 'localhost:9200/maptest?pretty' -H 'Content-Type: application/json' -d' | |
{ | |
"settings": { | |
"index": { |
OlderNewer