Created
August 9, 2011 21:27
-
-
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
This file contains 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
#!/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