Skip to content

Instantly share code, notes, and snippets.

@jakeemerson
Created April 9, 2015 18:40
Show Gist options
  • Save jakeemerson/177be3636695de4ec7e6 to your computer and use it in GitHub Desktop.
Save jakeemerson/177be3636695de4ec7e6 to your computer and use it in GitHub Desktop.
tokenizer with char filter
{
"settings": {
"number_of_shards": 5,
"analysis": {
"analyzer": {
"happy_tokens": {
"type": "pattern",
"tokenizer": "split_on_comma",
"char_filter": ["kill_pluses"]
}
},
"tokenizer": {
"split_on_comma": {
"type": "pattern",
"pattern": "([,]+)"
}
},
"char_filter": {
"kill_pluses": {
"type": "pattern_replace",
"pattern": "+",
"replace": " "
}
}
}
},
"mappings": {
"post" : {
"properties" : {
"query_string.keywords" : {
"type": "string",
"analyzer" : "happy_tokens"
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment