Skip to content

Instantly share code, notes, and snippets.

View lukas-vlcek's full-sized avatar

Lukáš Vlček lukas-vlcek

View GitHub Profile
$ ./bin/plugin install mapper-attachments
-> Installing mapper-attachments...
Trying http://elasticsearch.googlecode.com/svn/plugins/mapper-attachments/elasticsearch-mapper-attachments-0.18.7.zip...
Downloading .............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
client.admin().indices()
.preparePutTemplate("index_template")
.setTemplate("*")
.setSettings(
settingsBuilder()
.put("number_of_shards","1")
.put("number_of_replicas","0")
.build()
)
.addMapping("_all","{ \"_all\" : { \"analyzer\" : \"kstem_html_strip\" }}")
[2011-11-10 18:35:50,336] INFO 0[main] - org.elasticsearch.common.logging.log4j.Log4jESLogger.internalInfo(Log4jESLogger.java:93) - [Brand, Abigail] {0.18.2}[1458]: initializing ...
[2011-11-10 18:35:50,351] INFO 15[main] - org.elasticsearch.common.logging.log4j.Log4jESLogger.internalInfo(Log4jESLogger.java:93) - [Brand, Abigail] loaded [mapper-attachments], sites []
[2011-11-10 18:35:51,158]DEBUG 822[main] - org.elasticsearch.common.logging.log4j.Log4jESLogger.internalDebug(Log4jESLogger.java:85) - [Brand, Abigail] creating thread_pool [cached], type [cached], keep_alive [30s]
[2011-11-10 18:35:51,159]DEBUG 823[main] - org.elasticsearch.common.logging.log4j.Log4jESLogger.internalDebug(Log4jESLogger.java:85) - [Brand, Abigail] creating thread_pool [index], type [cached], keep_alive [5m]
[2011-11-10 18:35:51,159]DEBUG 823[main] - org.elasticsearch.common.logging.log4j.Log4jESLogger.internalDebug(Log4jESLogger.java:85) - [Brand, Abigail] creating thread_pool [search], type [cached], keep_alive [5m]
String template = slurp(getSystemClassLoader().getResourceAsStream("node/indexTemplate.json"));
Node node = getLocalNode();
Client client = node.client();
client.admin().indices()
.preparePutTemplate("index_template")
.setTemplate("*")
.setSettings(
settingsBuilder()
{
"_index" : {
"enabled" : true
},
"properties" : {
"document_url" : {
"type" : "string",
"store" : "yes",
@lukas-vlcek
lukas-vlcek / gist:1355512
Created November 10, 2011 17:32
Original template JSON used via REST
{
"template" : "*",
"settings" : {
"number_of_shards" : 1,
"number_of_replicas" : 0
},
"mappings" : {
"mail" : {
"_index" : { "enabled" : true },
"properties" : {
@lukas-vlcek
lukas-vlcek / gist:1242109
Created September 26, 2011 12:24
Should this work?
{
"query" : {
"match_all" : {}
},
"facets" : {
"range1" : {
"range" : {
"key_script" : "doc['date'].date.hourOfDay", // based on http://joda-time.sourceforge.net/api-release/org/joda/time/MutableDateTime.html
"value_script" : "1",
"ranges" : [
@lukas-vlcek
lukas-vlcek / gist:1200650
Created September 7, 2011 14:09
River test thread dump
Full thread dump OpenJDK 64-Bit Server VM (19.0-b09 mixed mode):
"Timer-4" daemon prio=10 tid=0x00007f0dd4005000 nid=0x6eb1 in Object.wait() [0x00007f0dc5056000]
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x00000000eedffdb0> (a java.util.TaskQueue)
at java.util.TimerThread.mainLoop(Timer.java:531)
- locked <0x00000000eedffdb0> (a java.util.TaskQueue)
at java.util.TimerThread.run(Timer.java:484)
@lukas-vlcek
lukas-vlcek / gist:1178089
Created August 29, 2011 09:35
ping failing #3
{
"_shards":{
"total":102,
"successful":68,
"failed":34,
"failures":[
{
"index":"richfaces",
"shard":2,
"reason":"BroadcastShardOperationFailedException[[richfaces][2] ]; nested: RemoteTransportException[[Maria Hill][inet[/10.34.40.115:9301]][/cluster/ping/broadcast/shard]]; nested: "
@lukas-vlcek
lukas-vlcek / gist:1178088
Created August 29, 2011 09:35
ping failing #2
{
"_shards":{
"total":102,
"successful":68,
"failed":34,
"failures":[
{
"index":"weld",
"shard":1,
"reason":"BroadcastShardOperationFailedException[[weld][1] ]; nested: RemoteTransportException[[Cybelle][inet[/10.34.40.114:9301]][/cluster/ping/broadcast/shard]]; nested: "