Skip to content

Instantly share code, notes, and snippets.

@PtkFerraro
Created May 10, 2017 20:42
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 PtkFerraro/eb3244bf8c589b234a13d7f2b693cf77 to your computer and use it in GitHub Desktop.
Save PtkFerraro/eb3244bf8c589b234a13d7f2b693cf77 to your computer and use it in GitHub Desktop.
Elastic Analysers & Mappings
{
"settings": {
"analysis": {
"analyzer": {
"title_default_analyzer": {
"type": "custom",
"tokenizer": "title_tokenizer",
"filter": [
"lowercase",
"brazilian_filter",
"asciifolding"
]
},
"title_snowball_analyzer": {
"type": "custom",
"tokenizer": "title_tokenizer",
"filter": [
"lowercase",
"brazilian_filter",
"asciifolding",
"snowball"
]
},
"title_shingle_analyzer": {
"type": "custom",
"tokenizer": "title_tokenizer",
"filter": [
"lowercase",
"brazilian_filter",
"shingle",
"asciifolding"
]
},
"title_ngram_analyzer": {
"type": "custom",
"tokenizer": "title_tokenizer",
"filter": [
"lowercase",
"brazilian_filter",
"asciifolding",
"edge_ngram_filter"
]
},
"title_search_analyzer": {
"type": "custom",
"tokenizer": "title_tokenizer",
"filter": [
"lowercase",
"brazilian_filter",
"asciifolding"
]
}
},
"filter": {
"brazilian_filter": {
"type": "stemmer",
"name": "brazilian",
"token_chars": [
"letter",
"digit"
]
},
"edge_ngram_filter": {
"type": "edgeNGram",
"min_gram": 3,
"max_gram": 50,
"token_chars": [
"letter",
"digit"
]
}
},
"tokenizer": {
"title_tokenizer": {
"type": "letter"
}
}
}
},
"mappings": {
"entersport": {
"_all": {
"enabled": false
},
"properties": {
"is_adult": {
"type": "boolean"
},
"match_start": {
"type": "date"
},
"match_title": {
"type": "text",
"fields": {
"title": {
"type": "text",
"analyzer": "title_default_analyzer"
},
"snowball": {
"type": "text",
"analyzer": "title_snowball_analyzer"
},
"shingles": {
"type": "text",
"analyzer": "title_shingle_analyzer"
},
"ngrams": {
"type": "text",
"analyzer": "title_ngram_analyzer",
"search_analyzer": "title_search_analyzer"
}
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment