Skip to content

Instantly share code, notes, and snippets.

View sebaes's full-sized avatar

Sebastian sebaes

View GitHub Profile
@sebaes
sebaes / MockScript.java
Last active December 16, 2015 23:29
RabbitMQ river scripting
package org.elasticsearch.river.rabbitmq.script;
import org.elasticsearch.common.jackson.JsonFactory;
import org.elasticsearch.common.xcontent.json.JsonXContentParser;
import org.elasticsearch.script.AbstractExecutableScript;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.CharArrayWriter;
import java.io.IOException;
@sebaes
sebaes / Java exception example
Created October 17, 2011 18:38
Exception case
import java.util.HashMap;
import java.util.Map;
import org.elasticsearch.action.ActionFuture;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.admin.indices.create.CreateIndexRequest;
import org.elasticsearch.action.admin.indices.create.CreateIndexResponse;
import org.elasticsearch.action.admin.indices.flush.FlushRequest;
{
"p" : {
"_all" : {"enabled" : "false"},
"_source" : {
"enabled" : true,
"compress" : true
},
"_type" : {
"index" : "no",
"store" : "no"
@sebaes
sebaes / gist:880814
Created March 22, 2011 05:15
Search filter in queries and not facets, expanded example from issue 650
curl -XPUT 'localhost:9200/twitter/tweet/1' -d '
{
"message" : "something blue",
"date" : "yesterday",
"tag" : "blue"
}
'
curl -XPUT 'localhost:9200/twitter/tweet/2' -d '
{
@sebaes
sebaes / document attempted
Created December 5, 2010 04:15
Analyzer alias problem
curl -XPUT 'http://sd:5100/indexx/typey/idz' -d '
{
"_analyzer":"all_analyzer",
"title":"a title"
}
'