Skip to content

Instantly share code, notes, and snippets.

@kennknowles
Created August 31, 2012 19:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kennknowles/3558149 to your computer and use it in GitHub Desktop.
Save kennknowles/3558149 to your computer and use it in GitHub Desktop.
ElasticSearch ShingleFilter arg reversal
curl -XPOST 'http://localhost:9200/test/?pretty=1' -d '{
"settings": {
"analysis":{
"analyzer": {
"my_analyzer": {
"type": "custom",
"filter": ["my_shingle_filter"],
"tokenizer": "standard"
}
},
"filter": {
"my_shingle_filter": {
"type": "shingle",
"min_shingle_size": 2,
"max_shingle_size": 4
}
}
}
}
}'
curl -XPUT 'http://localhost:9200/test/type/_mapping?pretty=1' -d '{
"type" : {
"properties" : {
"content": {
"type":"multi_field",
"fields":{
"raw_field" : {"type" : "string"},
"custom_field" : {"type" : "string", "analyzer":"my_analyzer"}
}
}
}
}
}'
curl -XPOST 'http://localhost:9200/test/type/example?pretty=1' -d '{
"content": "this is a test"
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment