mirror of
https://github.com/CodeforLeipzig/stadtratmonitor.git
synced 2025-04-20 07:11:33 +02:00
28 - use elasticsearch-analysis-decompound plugin to support finding results within compound words
This commit is contained in:
parent
7f1aead3a8
commit
5c96de3ded
4 changed files with 40 additions and 2 deletions
|
@ -21,11 +21,40 @@ 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"
|
||||
indexes :reference, type: :string, index: :not_analyzed
|
||||
indexes :paper_type, type: :string, index: :not_analyzed
|
||||
indexes :published_at, type: :date, index: :not_analyzed
|
||||
indexes :originator, type: :string, index: :not_analyzed
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue