Skip to content

Instantly share code, notes, and snippets.

@jinleileiking
Created November 3, 2015 07:41
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 jinleileiking/38a225cf3a80447655e6 to your computer and use it in GitHub Desktop.
Save jinleileiking/38a225cf3a80447655e6 to your computer and use it in GitHub Desktop.
#!/bin/bash
curl -XDELETE http://localhost:8200/history
curl -XPOST http://localhost:8200/history/ -d'
{
"settings" : {
"analysis" : {
"analyzer" : {
"pinyin_analyzer" : {
"tokenizer" : "my_pinyin",
"filter" : ["word_delimiter","nGram"]
}
},
"tokenizer" : {
"my_pinyin" : {
"type" : "pinyin",
"first_letter" : "prefix",
"padding_char" : " "
}
}
}
},
"mappings": {
"_default_" : {
"type": "string",
"store": "no",
"term_vector": "with_positions_offsets",
"analyzer": "pinyin_analyzer",
"boost": 10
}
}
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment