Skip to content

Instantly share code, notes, and snippets.

@monken
Created April 21, 2011 15:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save monken/934765 to your computer and use it in GitHub Desktop.
Save monken/934765 to your computer and use it in GitHub Desktop.
camelcase tokenizer
curl -XDELETE localhost:9200/test
curl -XPUT localhost:9200/test -d '
{
"settings":{
"analysis": {
"analyzer": {
"camel":{
"type": "pattern",
"lowercase": false,
"pattern":"(\\W+)|(?<=[a-z])(?=[A-Z])|(?<=[A-Z])(?=[A-Z])"
}
}
}
}
}'
curl localhost:9200/test/_analyze?analyzer=camel -d 'MooseX::ClassAttribute'
# returns Moose X Class Attribute
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment