Skip to content

Instantly share code, notes, and snippets.

@kimchy
Created April 21, 2012 15:04
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kimchy/2437609 to your computer and use it in GitHub Desktop.
Save kimchy/2437609 to your computer and use it in GitHub Desktop.
curl -XPUT localhost:9200/test -d '
{"settings": {
"analysis" :{
"analyzer": {
"exact_analyzer": {
"type": "custom",
"tokenizer":"my_pattern_tokenizer",
"filter":[]
}
},
"tokenizer": {
"my_pattern_tokenizer": {
"type":"pattern",
"pattern":"$^"
}
},
"filter": {
}
}
}
}
'
curl -XPUT localhost:9200/test/type/_mapping -d '{
"type" : {
"properties" : {
"category": {
"type":"multi_field",
"fields":{
"category" : {"type" : "string"},
"exactCategory" : {"type" : "string", "store": "yes", "analyzer":"exact_analyzer"}
}
}
}
}
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment