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 / davidson-collection.sh
Created November 15, 2012 21:26
analyzer test
curl -XDELETE 'http://localhost:9200/test'
curl -XPOST 'http://localhost:9200/test' -d '
{
"settings" : {
"index" : {
"analysis" : {
"filter": {
"eNGram" : {
"type": "edgeNGram",
@jprante
jprante / obj-style.sh
Created November 16, 2012 19:46
Magic Mapping ?
# value-style before object-style => "auto upgrade"
curl -XDELETE 'http://localhost:9200/test'
curl -XPUT 'localhost:9200/test/test/1' -d '
{
"obj" : "value"
}
'
@jprante
jprante / percolate.sh
Created November 22, 2012 13:36
Percolate with integers
#!/bin/bash
curl -XDELETE 'localhost:9200/notifave'
curl -XDELETE 'localhost:9200/_percolator'
curl -XPUT 'localhost:9200/notifave' -d '
{
"mappings" : {
"article" : {
@jprante
jprante / sort.sh
Created November 24, 2012 22:13
Sorting with undefined values
curl -XDELETE 'localhost:9200/sort'
curl -XPOST 'localhost:9200/sort'
curl -XPUT 'localhost:9200/sort/sort/1' -d '
{
"num" : 1
}
'
@jprante
jprante / scriptsort.sh
Created November 28, 2012 17:22
Scripted sorting
curl -XDELETE 'localhost:9200/scriptsort'
curl -XPOST 'localhost:9200/scriptsort' -d '
{
"mappings": {
"test": {
"_id": {
"index" : "not_analyzed",
"stored": "yes"
}
@jprante
jprante / cms.sh
Created December 6, 2012 11:30
Content with different languages
curl -XDELETE 'http://localhost:9200/test_cms'
curl -XPUT 'http://localhost:9200/test_cms'
curl -XPUT 'http://localhost:9200/test_cms/en/_mapping' -d '{
"document" : {
"properties": {
"name": { "type": "string" },
"content": {
"properties": {
@jprante
jprante / jsonld.sh
Created December 7, 2012 10:03
JSON-LD in Elasticsearch
curl -XDELETE 'localhost:9200/jsonld'
curl -XPOST 'localhost:9200/jsonld'
curl -XPUT 'localhost:9200/jsonld/doc/1' -d '
{
"@context":
{
"dc": "http://purl.org/dc/elements/1.1/",
@jprante
jprante / schoenertag.sh
Created December 7, 2012 16:23
Ein schöner Tag in Köln im Cafe
curl -XDELETE 'localhost:9200/ling'
echo '{
"settings" : {
"index" : {
"analysis" : {
"analyzer" : {
"default" : {
"type" : "custom",
@jprante
jprante / imcafe.sh
Created December 8, 2012 11:47
Ein schöner Tag in Köln im Café an der Straßenecke
# required plugins: analysis-icu, analysis-combo
# ./bin/plugin -install elasticsearch/elasticsearch-analysis-icu/1.7.0
# ./bin/plugin -install yakaz/elasticsearch-analysis-combo/1.1.0
#
curl -XDELETE 'localhost:9200/ling'
echo '{
"settings" : {
"index" : {
@jprante
jprante / version.sh
Created December 10, 2012 10:20
Versions
curl -XDELETE 'localhost:9200/test'
curl -XPUT 'localhost:9200/test/doc/1' -d '
{
"sentence" : "Hi 1!"
}
'