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 / beidermorse.sh
Created January 28, 2013 10:38
Demonstration of Beider-Morse phonetic filter with Elasticsearch
curl -XDELETE 'localhost:9200/test'
# grasp available rules with: jar tvf plugins/analysis-phonetic/commons-codec-*.jar | grep bm
curl -XPUT 'localhost:9200/test' -d '
{
"settings" : {
"index" : {
"analysis" : {
@jprante
jprante / parentchild.sh
Created February 19, 2013 08:58
Creating children docs before parent docs
curl -XDELETE 'localhost:9200/authors'
curl -XPUT 'localhost:9200/authors'
curl -XPOST 'localhost:9200/authors/work/_mapping' -d '{
"work": {
"_parent": {"type": "person"}
}
}'
{
"_source" : {
"dc:publisher" : {
"xbib:publisherName" : "Springer-Verlag GmbH.",
"xbib:publisherPlace" : "Berlin Heidelberg"
},
"dc:identifier" : {
"xbib:identifierAuthorityOriginISBN" : "978-3-540-31646-6",
"xbib:identifierAuthorityISBN" : "3540316469",
"xbib:sysID" : "(DE-605)016517113",
@jprante
jprante / BitwjgTest.java
Last active December 14, 2015 11:58
Java code example for bitwijg
package org.elasticsearch.test;
import org.elasticsearch.action.admin.indices.create.CreateIndexRequest;
import org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest;
import org.elasticsearch.action.admin.indices.refresh.RefreshRequest;
import org.elasticsearch.action.bulk.BulkRequestBuilder;
import org.elasticsearch.action.bulk.BulkResponse;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.client.Client;
import org.elasticsearch.common.logging.ESLogger;
curl -XDELETE 'localhost:9200/test'
curl -XPUT 'localhost:9200/test/doc/1' -d '
{
"sentence" : "Hi!",
"value" : 1
}
'
{
"comment" : "J. Prante, 14.08.2012",
"settings" : {
"index" : {
"analysis" : {
"filter" : {
"germansnow" : {
"type" : "snowball",
"language" : "German2"
},
@jprante
jprante / es-build-socketexception.log
Created March 17, 2013 22:51
Elasticsearch build: mvn test fails with PlainDatagramSocket exception "socket closed"
java -version
java version "1.7.0_15"
Java(TM) SE Runtime Environment (build 1.7.0_15-b03)
Java HotSpot(TM) 64-Bit Server VM (build 23.7-b01, mixed mode)
mvn --version
Apache Maven 3.0.4 (r1232337; 2012-01-17 09:44:56+0100)
Maven home: /usr/share/maven
Java version: 1.7.0_15, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.7.0_15.jdk/Contents/Home/jre
[INFO] --- maven-surefire-plugin:2.12.3:test (default-test) @ elasticsearch ---
[INFO] Surefire report directory: /data/es/jprante/elasticsearch/target/surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running org.elasticsearch.test.integration.recovery.FullRollingRestartTests
Configuring TestNG with: org.apache.maven.surefire.testng.conf.TestNG652Configurator@a326074
[2013-03-19 22:06:26,648][INFO ][test ] ==> Test Starting [integration.recovery.FullRollingRestartTests#testFullRollingRestart]
[2013-03-19 22:06:26,783][INFO ][node ] [node1] {0.90.0.Beta2-SNAPSHOT}[6471]: initializing ...
@jprante
jprante / update-index-settings.sh
Last active December 18, 2015 04:59
Elasticsearch: how to update index cache filter settings dynamically
curl -XDELETE 'localhost:9200/test'
curl -XPUT 'localhost:9200/test'
curl -XPOST 'localhost:9200/test/_close'
curl -XPUT 'localhost:9200/test/_settings' -d '
{
"cache" : {
"filter" : {
@jprante
jprante / gist:6002477
Last active December 19, 2015 18:58
JDBC river with jtds
[joerg@tyan elasticsearch-0.90.2]$ ls -lrt plugins/jdbc/
insgesamt 948
-rw-r--r--. 1 joerg joerg 584207 17. Feb 2012 sqljdbc4.jar
-rw-r--r--. 1 joerg joerg 62584 28. Feb 20:32 elasticsearch-river-jdbc-2.2.0.jar
-rw-r--r--. 1 joerg joerg 317816 8. Jun 12:27 jtds-1.3.1.jar
Curl test
curl -XPUT 'localhost:9200/_river/my_jdbc_river/_meta' -d '{