Skip to content

Instantly share code, notes, and snippets.

Created August 9, 2011 21:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save anonymous/1135250 to your computer and use it in GitHub Desktop.
Save anonymous/1135250 to your computer and use it in GitHub Desktop.
This is a script to reproduce a highlighting issue with the text_phrase_prefix query
#!/bin/sh
curl -XPOST 'http://localhost:9200/example_index/'
curl -XPOST 'http://localhost:9200/example_index/example_type/_mapping?pretty=true' -d \
'{
"example_type": {
"Properties": {
"name": {
"type": "string",
"term_vector": "with_positions_offsets",
"store": true
}
}
}
}'
curl -XPUT 'http://localhost:9200/example_index/example_type/1?pretty=true' -d \
'{
"name": "Multiple Terms Per Name"
}'
curl 'http://localhost:9200/example_index/example_type/_search?pretty=true' -d \
'{
"highlight": {
"fields": {
"name": {}
}
},
"query": {
"text_phrase_prefix": {
"name": "Multi"
}
}
}'
curl 'http://localhost:9200/example_index/example_type/_search?pretty=true' -d \
'{
"highlight": {
"fields": {
"name": {}
}
},
"query": {
"text_phrase_prefix": {
"name": "Multiple Term"
}
}
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment