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" -d ' | |
{ "mappings" : { "document" : { "properties" : { "body" : { "type" : "string", "analyzer" : "simple", "term_vector" : "with_positions_offsets" } } } } } | |
' | |
# Insert the data | |
curl -X POST "http://localhost:9200/highlight/document" -d '{ "body" : "The quick brown fox jumps over the lazy dog" }' | |
curl -X POST "http://localhost:9200/highlight/document" -d '{ "body" : "Lazy dog jumps over the quick brown fox" }' | |
curl -X POST "http://localhost:9200/highlight/document" -d '{ "body" : "A Fox one day fell into a deep well and could find no means of escape. A Goat, overcome with thirst, came to the same well, and seeing the Fox, inquired if the water was good. Concealing his sad plight under a merry guise, the Fox indulged in a lavish praise of the water, saying it was excellent beyond measure, and encouraging him to descend. The Goat, mindful only of his thirst, thoughtlessly jumped down, but ju |