Last active
September 23, 2015 13:32
Revisions
-
Edward Smit revised this gist
Sep 23, 2015 . 1 changed file with 9 additions and 9 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,7 @@ #!/usr/bin/env bash curl -XDELETE 'localhost:9200/highlightproblem'; echo curl -XPUT 'localhost:9200/highlightproblem'; echo curl -XPUT 'localhost:9200/highlightproblem/highlightproblem/_mapping' -d '{ "highlightproblem": { "properties": { @@ -14,24 +15,24 @@ curl -XPUT 'localhost:9200/highlightproblem/highlightproblem/_mapping' -d '{ } } } }'; echo curl -XPUT 'localhost:9200/highlightproblem/highlightproblem/1' -d '{ "title": "Highlight title", "body": "Highlight singular body" }'; echo curl -XPUT 'localhost:9200/highlightproblem/highlightproblem/2' -d '{ "title": "Highlight title", "body": ["array body", "array body 2"] }'; echo curl -XPUT 'localhost:9200/highlightproblem/highlightproblem/3' -d '{ "title": "Highlight title", "body": "Singular body" }'; echo curl -XPUT 'localhost:9200/highlightproblem/highlightproblem/4' -d '{ "title": "Highlight title", "body": ["highlight array body", "array body 2"] }'; echo curl -XPOST 'http://localhost:9200/highlightproblem/_refresh'; echo curl -XPOST 'http://localhost:9200/highlightproblem/_search?pretty' -d '{ "query": { "match": { @@ -48,5 +49,4 @@ curl -XPOST 'http://localhost:9200/highlightproblem/_search?pretty' -d '{ } } }' echo "Observe the missing highlight-field containing the no_match contents for #id 2" -
Edward Smit created this gist
Sep 23, 2015 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,52 @@ #!/usr/bin/env bash curl -XPUT 'localhost:9200/highlightproblem' curl -XPUT 'localhost:9200/highlightproblem/highlightproblem/_mapping' -d '{ "highlightproblem": { "properties": { "title": { "type": "string", "term_vector": "with_positions_offsets" }, "body": { "type": "string", "term_vector": "with_positions_offsets" } } } }' curl -XPUT 'localhost:9200/highlightproblem/highlightproblem/1' -d '{ "title": "Highlight title", "body": "Highlight singular body" }' curl -XPUT 'localhost:9200/highlightproblem/highlightproblem/2' -d '{ "title": "Highlight title", "body": ["array body", "array body 2"] }' curl -XPUT 'localhost:9200/highlightproblem/highlightproblem/3' -d '{ "title": "Highlight title", "body": "Singular body" }' curl -XPUT 'localhost:9200/highlightproblem/highlightproblem/4' -d '{ "title": "Highlight title", "body": ["highlight array body", "array body 2"] }' curl -XPOST 'http://localhost:9200/highlightproblem/_refresh' curl -XPOST 'http://localhost:9200/highlightproblem/_search?pretty' -d '{ "query": { "match": { "_all": "highlight" } }, "highlight": { "fields": { "body": { "fragment_size": 100, "number_of_fragments": 2, "no_match_size": 100 } } } }' echo "Observe the missing highlight-field containing the no_match contents for #id 2" curl -XDELETE 'localhost:9200/highlightproblem'