Skip to content

Instantly share code, notes, and snippets.

@dadoonet
Last active December 31, 2015 15:39
Show Gist options
  • Save dadoonet/8008466 to your computer and use it in GitHub Desktop.
Save dadoonet/8008466 to your computer and use it in GitHub Desktop.
# Delete the index `testindex`
curl -XDELETE 'http://localhost:9200/test' ; echo
# Create the index `testindex`
curl -XPUT 'http://localhost:9200/test' -d '{
"settings" : {
"index" : {
"number_of_shards" : 1,
"number_of_replicas" : 0
},
"analysis" : {
"analyzer" : {
"default" : {
"tokenizer" : "standard",
"filter" : ["standard", "elision"]
}
},
"filter" : {
"elision" : {
"type" : "elision",
"articles" : ["l", "m", "t", "qu", "n", "s", "j"]
}
}
}
}
}' ; echo
# Wait for yellow
curl -XGET 'http://localhost:9200/_cluster/health?wait_for_status=yellow' ; echo
# Testing Elision filter
# http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/analysis-elision-tokenfilter.html
# analyze it
curl -XPOST 'http://localhost:9200/test/_analyze?analyzer=default&pretty' -d "l'avion" ; echo
{
"tokens" : [ {
"token" : "avion",
"start_offset" : 0,
"end_offset" : 7,
"type" : "<ALPHANUM>",
"position" : 1
} ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment