Skip to content

Instantly share code, notes, and snippets.

@jpountz
Created December 16, 2013 10:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jpountz/7984942 to your computer and use it in GitHub Desktop.
Save jpountz/7984942 to your computer and use it in GitHub Desktop.
Highlighting of stop words
curl -XDELETE 'localhost:9200/test?pretty'
echo
curl -XPUT 'localhost:9200/test?pretty' -d '
{
"settings" : {
"index" : {
"analysis" : {
"analyzer" : {
"default" : {
"type" : "standard",
"stopwords" : "_none_"
}
}
}
}
}
}'
echo
curl -XPUT 'localhost:9200/test/test/1?pretty' -d '
{
"f" : "We live in NY"
}'
echo
curl -XPOST 'localhost:9200/test/_refresh?pretty'
echo
curl -XGET 'localhost:9200/test/_search?pretty' -d '
{
"query": {
"match" : {
"f" : "we live in NY"
}
},
"highlight": {
"fields" : {
"f" : {}
}
}
}'
echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment