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 / elasticsearch_highlight.sh
Created April 21, 2011 08:29 — forked from karmi/elasticsearch_highlight.sh
Highligthing in ElasticSearch; number_of_fragments bug
# (Re)create the index
curl -X DELETE "http://localhost:9200/highlight"
curl -X PUT "http://localhost:9200/highlight"
# Put some mapping, do not store the content (so it has to be retrieved from `_source` but you have to set term_vector = with_positions_offsets
curl -X PUT "http://localhost:9200/highlight/document/_mapping" -d '
{
"document" : {
"properties" : {
"body" : {"type" : "string", "store" : "no", "term_vector" : "with_positions_offsets"}
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")