Skip to content

Instantly share code, notes, and snippets.

View lukas-vlcek's full-sized avatar

Lukáš Vlček lukas-vlcek

View GitHub Profile
@lukas-vlcek
lukas-vlcek / gist:9641455
Last active August 29, 2015 13:57 — forked from pmuir/gist:9639232
{
"sys_title":"Have Your Cake and Eat It Too : Forge Tools",
# "sys_content_id":"23585936", # taken from URL
# "sys_content":null, # omit if empty
"sys_description":"We are currently working on the integration of Forge in JBoss Tools.",
"sys_url_view":"http://http://localhost:4242/video/vimeo/23585936",
# "sys_content_type":"video/vimeo", # taken from URL, in this case 'jbossdeveloper_video'
"sys_type":"jbossdeveloper_video",
# "sys_content_provider":"jboss-developer", # derived from credentials (http basic auth)
"author":{"display_name":"Koen Aers","id":"6802538","role":"","username":"user6802538"},
@lukas-vlcek
lukas-vlcek / gist:c8cd42be64eaca454bcd
Created June 29, 2014 19:08
Trying to transpile (ng2) di.js to ES5
// Trying to follow
// https://github.com/angular/di.js#transpiling-es6
[lukas di.js]$ sudo npm install -g gulp
Password:
/usr/local/bin/gulp -> /usr/local/lib/node_modules/gulp/bin/gulp.js
gulp@3.8.5 /usr/local/lib/node_modules/gulp
├── tildify@0.2.0
├── interpret@0.3.4
├── pretty-hrtime@0.2.1
@lukas-vlcek
lukas-vlcek / gist:56540a7e8206d122d55c
Created October 31, 2014 18:04
Search Template with Sections?
## This works:
curl -X GET 'localhost:9200/_search/template' -d '{
"template" : "{ \"size\": \"{{size}}\", \"query\":{\"match_all\":{}}}",
"params":{
"size":1,
"use_size": false
}
}'
curl -XPUT 'http://localhost:9200/testdb2/' -d '{index : {number_of_shards : 3, number_of_replicas : 0}}'
@lukas-vlcek
lukas-vlcek / this is fine
Created February 2, 2011 16:37
This is fine
Query:
{
"query" : { "match_all" : {}}, "size" : 0,
"facets" : {
"message-id" : {
"terms" : {
"field" : "message-id",
"size" : 3,
"order" : "count"
@lukas-vlcek
lukas-vlcek / gist:814372
Created February 7, 2011 13:40
some exception
[2011-02-07 14:28:05,821]ERROR186038[Thread-16] - org.jboss.search.client.IndexMboxFile$Batch.execute(IndexMboxFile.java:82) - Indexing failed:
org.elasticsearch.transport.RemoteTransportException: [Janus][inet[/192.168.122.1:9300]][indices/index/shard/index]
Caused by: org.elasticsearch.index.engine.IndexFailedEngineException: [weld][0] Index failed for [mail#db199550911051438p2f675865jc9230bf30a9f8f4email.gmail.comdev615]
at org.elasticsearch.index.engine.robin.RobinEngine.index(RobinEngine.java:396)
at org.elasticsearch.index.shard.service.InternalIndexShard.index(InternalIndexShard.java:273)
at org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:180)
at org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$AsyncShardOperationAction.performOnPrimary(TransportShardReplicationOperationAction.java:428)
at org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$AsyncShardOperationAction.access$
require 'rubygems'
require 'net/http'
require 'yaml'
require 'json'
# kill the index
delete = Net::HTTP::Delete.new("/test")
# create again
create_index = Net::HTTP::Post.new("/test")
@lukas-vlcek
lukas-vlcek / gist:827320
Created February 15, 2011 09:45
Client hanging after thread pool refactoring.
Full thread dump OpenJDK 64-Bit Server VM (19.0-b09 mixed mode):
"elasticsearch[cached]-pool-1-thread-7" daemon prio=10 tid=0x00007f678c002800 nid=0x5909 waiting on condition [0x00007f677b8f7000]
java.lang.Thread.State: TIMED_WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x00000000c3e27618> (a java.util.concurrent.SynchronousQueue$TransferStack)
at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:226)
at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:453)
at java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:352)
at java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:903)
org.elasticsearch.search.SearchParseException: [indexName][2]: query[ConstantScore(*:*)],from[-1],size[-1]: Parse Failure [Failed to parse source [{"query":{"query_string":{"query":"*"}},"facets":{"histogram":{"date_histogram":{"field":"date","interval":"1w"}}}}]]
at org.elasticsearch.search.SearchService.parseSource(SearchService.java:470)
at org.elasticsearch.search.SearchService.createContext(SearchService.java:385)
at org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:215)
at org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:134)
at org.elasticsearch.action.search.type.TransportSearchCountAction$AsyncAction.sendExecuteFirstPhase(TransportSearchCountAction.java:74)
at org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:191)
at org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.access$000(TransportSearchTypeActio
curl -XPUT ${host}/_template/template_mail -d '
{
"template" : "*",
"settings" : {
"number_of_shards" : 3,
"number_of_replicas" : 1
},
"mappings" : {
"mail" : {
"_index" : { "enabled" : true },