Given the document
curl -XPUT 'localhost:9200/test/me/here' -d '{
"top" : [
{ "searchkey" : "change"},
{ "searchkey" : "keep"}
]
}'
(defn fibonacci-loop [n] | |
(loop [iter 0 fibs '()] | |
(cond | |
(= iter n) (reverse fibs) | |
(= iter 0) (recur (inc iter) (conj fibs 1)) | |
(= iter 1) (recur (inc iter) (conj fibs 1)) | |
:else (recur (inc iter) (conj fibs (reduce + (take 2 fibs)))) | |
))) |
// Shall be executed with -Dfile.encoding=UTF-16 to construct correct String instance | |
public class LigatureTest { | |
public static void main(String[] args) { | |
byte[] baffle = "ba\uFB00le".getBytes(Charset.forName("UTF-16")); | |
System.out.println(new String(baffle).toUpperCase()); | |
} | |
} |
#!/bin/bash | |
if [ ! -d $1 ]; then | |
echo $1 " must be directory" | |
exit | |
fi | |
if [ ! -d $2 ]; then | |
echo $2 " must be directory" | |
exit | |
fi |
(require 'package) | |
(add-to-list 'package-archives | |
'("marmalade" . "http://marmalade-repo.org/packages/")) | |
(package-initialize) | |
(add-to-list 'load-path "~/.emacs.d/scripts") | |
(add-to-list 'load-path "~/.emacs.d/git-libs/es-lib") | |
(defvar my-packages '(cider |
ZSH=$HOME/.oh-my-zsh | |
ZSH_THEME="fishy" | |
DISABLE_CORRECTION="true" | |
COMPLETION_WAITING_DOTS="true" | |
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*) | |
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ | |
plugins=(jira git-fast history-substring-search completion history emacs oh-my-settings oh-my-company) |
# PATHS | |
WORKBENCH=~/Workbench | |
PATH=~/bin:${PATH} | |
JAVA_HOME=/usr/java/latest/ | |
PATH=${JAVA_HOME}:${PATH} | |
TMP=/tmp; export TMP | |
TMPDIR=$TMP; export TMPDIR |
import os | |
import glob | |
import twitter.common.java.perfdata as twc | |
if __name__ == '__main__': | |
pattern = os.path.join('/tmp', 'hsperfdata_*', '*') | |
for path in glob.glob(pattern): | |
root, pid = os.path.split(path) | |
dirname = os.path.basename(root) |
import multiprocessing | |
import time | |
import os | |
class PMonitor(multiprocessing.Process): | |
def __init__(self, process_id): | |
super(PMonitor, self).__init__() | |
self.process_id = str(process_id) | |
self.semaphore = multiprocessing.Event() |
Given the document
curl -XPUT 'localhost:9200/test/me/here' -d '{
"top" : [
{ "searchkey" : "change"},
{ "searchkey" : "keep"}
]
}'
Have existing document already in ES
{
"service" : "A",
"timestamp" : "2014-06-06T12:12:59.456+00:00"
}
and want to update it to get this