Skip to content

Instantly share code, notes, and snippets.

@alh3im
Created June 29, 2011 07:54
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 alh3im/98fccd76d8b4b1b1f0b1 to your computer and use it in GitHub Desktop.
Save alh3im/98fccd76d8b4b1b1f0b1 to your computer and use it in GitHub Desktop.
Stemmer issue
// Configuration
{
"index" : {
"analysis" : {
"filter" : {
"my_ngram" : {
"max_gram" : 20,
"min_gram" : 2,
"type" : "nGram"
},
"my_stemmer" : {
"type" : "stemmer",
"name" : "light_french"
}
},
"analyzer" : {
"lowercase_keyword" : {
"filter" : [
"standard",
"lowercase",
"my_stemmer"
],
"type" : "custom",
"tokenizer" : "keyword"
},
"lowercase_keyword_ngram" : {
"filter" : [
"standard",
"lowercase",
"my_stemmer",
"my_ngram"
],
"type" : "custom",
"tokenizer" : "keyword"
}
}
}
}
}
// Mapping
{
"mapping": {
"properties": {
"title": {
"type": "string",
"indexAnalyzer": "lowercase_keyword_ngram",
"searchAnalyzer": "lowercase_keyword"
}
}
}
}
// Add some data
{"title":"élève"}
// Search
{
"query": {
"term": {
"title": "élève"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment