diff options
author | 2019-10-07 17:02:20 +0200 | |
---|---|---|
committer | 2019-10-07 17:02:20 +0200 | |
commit | 3c9eaa1329e1ba0a05c286b989df207e8e74d70b (patch) | |
tree | 1b3dd3594d2de10a41853721b0ff955f7b4915af | |
parent | Add further mappings for the indexes (diff) | |
download | packages-5-3c9eaa1329e1ba0a05c286b989df207e8e74d70b.tar.gz packages-5-3c9eaa1329e1ba0a05c286b989df207e8e74d70b.tar.bz2 packages-5-3c9eaa1329e1ba0a05c286b989df207e8e74d70b.zip |
Turn off dynamic mapping in all indexesv7.0.4
By default, fields are added dynamically, whenever they are not present
in the current mapping. However, we exactly specify the mapping, so we
don't want any unexpected fields to be added to the index.
That's why we use 'strict' here. This way we will get an exception every
time an unexpected field is detected (which should not happen).
Signed-off-by: Max Magorsch <max@magorsch.de>
-rw-r--r-- | app/repositories/category_repository.rb | 2 | ||||
-rw-r--r-- | app/repositories/change_repository.rb | 2 | ||||
-rw-r--r-- | app/repositories/commit_repository.rb | 2 | ||||
-rw-r--r-- | app/repositories/package_repository.rb | 2 | ||||
-rw-r--r-- | app/repositories/useflag_repository.rb | 2 | ||||
-rw-r--r-- | app/repositories/version_repository.rb | 2 |
6 files changed, 6 insertions, 6 deletions
diff --git a/app/repositories/category_repository.rb b/app/repositories/category_repository.rb index e9cf033..d707df9 100644 --- a/app/repositories/category_repository.rb +++ b/app/repositories/category_repository.rb @@ -9,7 +9,7 @@ class CategoryRepository < BaseRepository klass Category - mapping do + mapping dynamic: 'strict' do indexes :id, type: 'keyword' indexes :name, type: 'text' indexes :description, type: 'text' diff --git a/app/repositories/change_repository.rb b/app/repositories/change_repository.rb index 9797974..d0e5177 100644 --- a/app/repositories/change_repository.rb +++ b/app/repositories/change_repository.rb @@ -9,7 +9,7 @@ class ChangeRepository < BaseRepository klass Change - mapping do + mapping dynamic: 'strict' do indexes :id, type: 'keyword' indexes :package, type: 'keyword' indexes :category, type: 'keyword' diff --git a/app/repositories/commit_repository.rb b/app/repositories/commit_repository.rb index 146087a..79702d8 100644 --- a/app/repositories/commit_repository.rb +++ b/app/repositories/commit_repository.rb @@ -9,7 +9,7 @@ class CommitRepository < BaseRepository klass Commit - mapping do + mapping dynamic: 'strict' do indexes :id, type: 'keyword' indexes :author, type: 'keyword' indexes :email, type: 'keyword' diff --git a/app/repositories/package_repository.rb b/app/repositories/package_repository.rb index 6b51910..06856aa 100644 --- a/app/repositories/package_repository.rb +++ b/app/repositories/package_repository.rb @@ -14,7 +14,7 @@ class PackageRepository < BaseRepository klass Package - mapping do + mapping dynamic: 'strict' do indexes :id, type: 'keyword' indexes :category, type: 'keyword' indexes :name, type: 'keyword' diff --git a/app/repositories/useflag_repository.rb b/app/repositories/useflag_repository.rb index a80b5f4..632de48 100644 --- a/app/repositories/useflag_repository.rb +++ b/app/repositories/useflag_repository.rb @@ -12,7 +12,7 @@ class UseflagRepository < BaseRepository klass Useflag - mapping do + mapping dynamic: 'strict' do indexes :id, type: 'keyword' indexes :name, type: 'text' indexes :description, type: 'text' diff --git a/app/repositories/version_repository.rb b/app/repositories/version_repository.rb index e28f5e7..2932677 100644 --- a/app/repositories/version_repository.rb +++ b/app/repositories/version_repository.rb @@ -12,7 +12,7 @@ class VersionRepository < BaseRepository klass Version - mapping do + mapping dynamic: 'strict' do indexes :id, type: 'keyword' indexes :version, type: 'keyword' indexes :package, type: 'keyword' |