Skip to content

Instantly share code, notes, and snippets.

View jprante's full-sized avatar
💤
Dormant

Jörg Prante jprante

💤
Dormant
View GitHub Profile
@jprante
jprante / ilovees.txt
Created March 5, 2016 18:29
I love ES
DELETE /test
PUT /test/
{
"settings": {
"analysis": {
"char_filter": {
"emoticon": {
"type": "mapping",
"mappings": [
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
PUT /test
POST /test/doc/_mapping
{
"properties": {
"message": {
"fielddata": {
"format": "disabled"
},
"index": "analyzed",
"omit_norms": true,
@jprante
jprante / example-multifield-2.txt
Last active November 30, 2015 22:10
Simple Elasticsearch example for multifield
PUT /test/
{
"mappings": {
"docs" : {
"properties": {
"foo" : {
"type" : "string",
"fields": {
"bar" : {
"type": "string",
@jprante
jprante / standalone.xml
Created November 12, 2015 15:59
ES client app deps
<?xml version="1.0"?>
<assembly>
<id>standalone</id>
<formats>
<format>jar</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<dependencySets>
<dependencySet>
<outputDirectory>/</outputDirectory>
@jprante
jprante / elasticsearch.yml
Created November 10, 2015 23:26
1.5.2 config
bootstrap:
mlockall: true
store:
index:
type: mmapfs
network:
host: _local_
@jprante
jprante / gist:0cb8e5492191afda28d7
Last active November 2, 2015 16:29
ES 2.0.0 UTF-8 BOM failure on _bulk
perl -e 'print "\xEF\xBB\xBF"' > test.dat
echo '{ "index" : { "_index" : "test", "_type" : "type1", "_id" : "1" } }' >> test.dat
echo '{ "field1" : "value1" }' >> test.dat
hexdump -C test.dat
00000000 ef bb bf 7b 20 22 69 6e 64 65 78 22 20 3a 20 7b |...{ "index" : {|
00000010 20 22 5f 69 6e 64 65 78 22 20 3a 20 22 74 65 73 | "_index" : "tes|
00000020 74 22 2c 20 22 5f 74 79 70 65 22 20 3a 20 22 74 |t", "_type" : "t|
00000030 79 70 65 31 22 2c 20 22 5f 69 64 22 20 3a 20 22 |ype1", "_id" : "|
00000040 31 22 20 7d 20 7d 0a 7b 20 22 66 69 65 6c 64 31 |1" } }.{ "field1|
@jprante
jprante / main.go
Created October 17, 2015 15:11
Testing a HTTP ES client in Go
package main
import (
"fmt"
"github.com/satori/go.uuid"
"os"
//"crypto/tls"
"bytes"
"encoding/json"
"github.com/Sirupsen/logrus"
@jprante
jprante / fieldcount.json
Created July 19, 2015 21:43
UNIMARC field count demo
curl 'localhost:9200/serres/_fieldcount?pretty'
{
"serres" : {
"serres" : {
"total" : 51279,
"count" : [ {
"001._" : 51279,
"percent" : 100.0
}, {
"005._" : 51279,