Skip to content

Instantly share code, notes, and snippets.

@santiago
Created June 26, 2013 00:44
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 santiago/5863810 to your computer and use it in GitHub Desktop.
Save santiago/5863810 to your computer and use it in GitHub Desktop.
{
"settings": {
"index": {
"analysis": {
"char_filter" : {
"remove_punctuation" : {
"type" : "mapping",
"mappings" : [ ".=>-", ",=>-", ";=>-" ]
}
},
"filter": {
"es_stop_filter": {
"type": "stop",
"stopwords": [ "_spanish_", "d", "q", "tal" ]
},
"es_stem_filter": {
"type": "stemmer",
"name": "minimal_portuguese"
},
"shingles_filter": {
"type": "shingle",
"output_unigrams": false
}
},
"analyzer": {
"es_tweetAnalyzer": {
"type": "custom",
"tokenizer": "icu_tokenizer",
"char_filter" : [ "remove_punctuation" ],
"filter": [
"icu_folding",
"icu_normalizer",
"es_stop_filter"
]
},
"shinglesAnalyzer": {
"type": "custom",
"tokenizer": "standard",
"char_filter" : [ "remove_punctuation" ],
"filter": [
"shingles_filter"
]
}
}
}
}
},
"mappings": {
"analysis": {
"_source": {
"enabled": true
},
"_all": {
"enabled": false
},
"index.query.default_field": "text",
"properties": {
"id": {
"type": "string",
"index": "not_analyzed"
},
"user_id": {
"type": "string",
"index": "not_analyzed"
},
"created_at": {
"type": "date"
},
"text": {
"type": "multi_field",
"fields": {
"text": {
"type": "text",
"index": "not_analyzed"
},
"terms": {
"index": "analyzed",
"analyzer": "es_tweetAnalyzer",
"store": "yes"
},
"shingles": {
"index": "analyzed",
"analyzer": "shinglesAnalyzer",
"store": "yes"
}
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment