Skip to content

Instantly share code, notes, and snippets.

@selcukusta
Created June 19, 2017 12:12
Show Gist options
  • Select an option

  • Save selcukusta/a42ede9cee2cf6d778fb058e11eba41c to your computer and use it in GitHub Desktop.

Select an option

Save selcukusta/a42ede9cee2cf6d778fb058e11eba41c to your computer and use it in GitHub Desktop.
curl -X PUT \
http://localhost:9200/medium_sample_index \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-d '{
"settings": {
"number_of_shards": 1,
"number_of_replicas": 0,
"analysis": {
"filter": {
"synonym": {
"type": "synonym",
"synonyms_path": "synonyms/source.txt",
"ignore_case": true
},
"ngram": {
"type": "nGram",
"min_gram": 1,
"max_gram": 20
}
},
"analyzer": {
"index": {
"filter": [
"ngram",
"synonym",
"lowercase",
"asciifolding",
"word_delimiter"
],
"char_filter": [
"html_strip"
],
"tokenizer": "standard"
},
"search": {
"filter": [
"synonym",
"lowercase",
"asciifolding",
"word_delimiter"
],
"char_filter": [
"html_strip"
],
"tokenizer": "standard"
}
}
}
},
"mappings": {
"sample_type": {
"properties": {
"title": {
"type": "text",
"analyzer": "index",
"search_analyzer": "search"
}
}
}
}
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment