Skip to content

Instantly share code, notes, and snippets.

@clintongormley
Forked from monken/gist:934765
Created April 30, 2011 11:02
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save clintongormley/949602 to your computer and use it in GitHub Desktop.
Save clintongormley/949602 to your computer and use it in GitHub Desktop.
camelcase tokenizer
curl -XDELETE localhost:9200/test
curl -XPUT 'localhost:9200/test?pretty=1' -d '
{
"settings":{
"analysis": {
"analyzer": {
"camel":{
"type": "pattern",
"lowercase": true,
"pattern":"([^\\p{L}\\d]+)|(?<=\\D)(?=\\d)|(?<=\\d)(?=\\D)|(?<=[\\p{L}&&[^\\p{Lu}]])(?=\\p{Lu})|(?<=\\p{Lu})(?=\\p{Lu}[\\p{L}&&[^\\p{Lu}]])"
}
}
}
}
}'
curl 'localhost:9200/test/_analyze?pretty=1&analyzer=camel' -d 'MooseX::FTPClass foo_bar123Baz'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment