This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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"}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# (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"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") |