Skip to content

Instantly share code, notes, and snippets.

@wesplunk
Created February 9, 2012 15:25
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 wesplunk/1780664 to your computer and use it in GitHub Desktop.
Save wesplunk/1780664 to your computer and use it in GitHub Desktop.
elastic search dynamic mapping issue
{
"template": "*",
"settings": {
"number_of_shards": 2,
"number_of_replicas": 1,
"search": {
"slowlog": {
"level": "trace",
"threshold": {
"query": {
"warn": "10s",
"info": "5s",
"debug": "2s",
"trace": "500ms"
},
"fetch": {
"warn": "1s",
"info": "800ms",
"debug": "500ms",
"trace": "200ms"
}
}
}
},
"analysis": {
"analyzer": {
"defaultAnalyzerForStringSorting": {
"type": "custom",
"char_filter": "html_strip",
"tokenizer": "keyword",
"filter": [
"icu_normalizer"
]
},
"defaultAnalyzerForStringSearching": {
"type": "custom",
"char_filter": "html_strip",
"tokenizer": "uax_url_email",
"filter": [
"icu_normalizer"
]
}
}
}
},
"mappings": {
"catchAll": {
"_all": {
"enabled": false
},
"_source": {
"enabled": false
},
"numeric_detection": true,
"date_detection": true,
"dynamic_templates": [
{
"stringMappingTemplate": {
"match": "*",
"match_mapping_type": "string",
"mapping": {
"type": "string",
"store": "yes",
"index": "analyzed",
"analyzer": "defaultAnalyzerForStringSearching"
}
}
}
]
}
}
}
{
"strField1": "hello this is my first string field. I hope you enjoy it"
}
{
_index: test
_type: catchAll
_id: TOMAxqmtQzGZIuO-qDu5VA
_version: 1
_score: 1
}
properties: {
strField1: {
store: yes
,analyzer: defaultAnalyzerForStringSearching
,type: string
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment