Skip to content

Instantly share code, notes, and snippets.

@alfetopito
Created July 24, 2012 15:48
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 alfetopito/3170803 to your computer and use it in GitHub Desktop.
Save alfetopito/3170803 to your computer and use it in GitHub Desktop.
ElasticSearch Mappings and Analyzer
# Mappings
curl -XGET 'http://localhost:9200/tokens,keywords/_mapping?pretty=true'
{
"keywords" : {
"pt_BR" : {
"properties" : {
"keyword" : {
"type" : "string",
"boost" : 10.0,
"analyzer" : "keyword",
"store" : "yes",
"null_value" : ""
}
}
}
},
"tokens" : {
"pt_BR" : {
"properties" : {
"keyword" : {
"type" : "string",
"boost" : 10.0,
"analyzer" : "token_analyzer"
}
}
}
}
}
# Analyzer
"analyzer": {
"token_analyzer": {
"type": "brazilian",
# just a few stopwords
"stop_words": ["de", "a", "o", "que", "e", "do", "da", "em"],
"tokenizer": "standard"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment