Merge pull request #36 from joergreichert/28-stemming

Query "Tafeln" should also find entries with "Tafel"
This commit is contained in:
Jörg Reichert 2017-01-01 15:15:42 +01:00 committed by GitHub
commit 9b7a3da1de
4 changed files with 39 additions and 2 deletions

View file

@ -21,8 +21,36 @@ class Paper < ActiveRecord::Base
index_name ['srm', Rails.env, self.base_class.to_s.pluralize.underscore].join('_')
settings index: { number_of_shards: 1 } do
mappings dynamic: false do
settings index: {
number_of_shards: 1,
analysis: {
filter: {
german_stop: {
type: "stop",
stopwords: "_german_"
},
german_stemmer: {
type: "stemmer",
language: "light_german"
},
decomp: {
type: "decompound"
}
},
analyzer: {
german: {
tokenizer: "standard",
filter: [
"lowercase",
"german_stop",
"german_normalization",
"german_stemmer",
"decomp"
]
}
}
}
} do mappings dynamic: false do
indexes :name, type: :string, analyzer: "german"
indexes :content, type: :string, analyzer: "german"
indexes :resolution, type: :string, analyzer: "german"