Skip to content

Instantly share code, notes, and snippets.

@ilude
Created September 24, 2014 21:56
Show Gist options
  • Select an option

  • Save ilude/32c50534e9da8a4b4e68 to your computer and use it in GitHub Desktop.

Select an option

Save ilude/32c50534e9da8a4b4e68 to your computer and use it in GitHub Desktop.
curl -XDELETE 'localhost:9200/test-index/'
curl -XPUT 'localhost:9200/test-index/'
curl -XPOST 'localhost:9200/test-index/_close'
curl -XPUT 'localhost:9200/test-index/_settings' -d '
{
"settings": {
"analysis": {
"tokenizer":{
"part_tokenizer":{
"type":"pattern",
"pattern":"\\W+"
}
},
"filter" : {
"part_ngram_filter": {
"type": "edge_ngram",
"min_gram": 2,
"max_gram": 15
}
},
"analyzer": {
"part_analyzer": {
"type": "custom",
"tokenizer": "part_tokenizer",
"filter": [
"lowercase",
"part_ngram_filter"
]
}
}
}
}
}'
curl -XPOST 'localhost:9200/test-index/_open' && echo
curl -XGET 'http://localhost:9200/test-index/_settings?pretty=true' && echo
curl -XGET 'http://localhost:9200/test-index/_analyze?analyzer=part_analyzer&pretty=true' -d 'RAM-101U' && echo
curl -XGET 'http://localhost:9200/test-index/_analyze?analyzer=part_analyzer&pretty=true' -d 'RAM-101-COMO1AS' && echo
curl -XGET 'http://localhost:9200/test-index/_analyze?analyzer=part_analyzer&pretty=true' -d 'RAM-101-B-218-1U' && echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment