aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Magorsch <max@magorsch.de>2019-10-07 17:01:00 +0200
committerMax Magorsch <max@magorsch.de>2019-10-07 17:01:00 +0200
commit971e75441090dcdac6a27b8352ec95636404e89f (patch)
tree9fb72365bcaaa275f6ee12e9b4128be93afd6290
parentRemove dynamic field names from the packages index (diff)
downloadpackages-5-971e75441090dcdac6a27b8352ec95636404e89f.tar.gz
packages-5-971e75441090dcdac6a27b8352ec95636404e89f.tar.bz2
packages-5-971e75441090dcdac6a27b8352ec95636404e89f.zip
Add further mappings for the indexes
The mapping for maintainers field in the package index has been added. Furthermore, the commit field in the change index has been changed from object to keyword. However, currently, it is not used. It may be removed in future versions. Finally, missing id fields have been added to the mappings. Signed-off-by: Max Magorsch <max@magorsch.de>
-rw-r--r--app/repositories/change_repository.rb3
-rw-r--r--app/repositories/package_repository.rb9
-rw-r--r--app/repositories/useflag_repository.rb1
-rw-r--r--app/repositories/version_repository.rb1
4 files changed, 12 insertions, 2 deletions
diff --git a/app/repositories/change_repository.rb b/app/repositories/change_repository.rb
index e5cc2f2..9797974 100644
--- a/app/repositories/change_repository.rb
+++ b/app/repositories/change_repository.rb
@@ -10,12 +10,13 @@ class ChangeRepository < BaseRepository
klass Change
mapping do
+ indexes :id, type: 'keyword'
indexes :package, type: 'keyword'
indexes :category, type: 'keyword'
indexes :change_type, type: 'keyword'
indexes :version, type: 'keyword'
indexes :arches, type: 'keyword'
- indexes :commit, type: 'object'
+ indexes :commit, type: 'keyword'
indexes :created_at, type: 'date'
indexes :updated_at, type: 'date'
end
diff --git a/app/repositories/package_repository.rb b/app/repositories/package_repository.rb
index bac4aec..6b51910 100644
--- a/app/repositories/package_repository.rb
+++ b/app/repositories/package_repository.rb
@@ -15,6 +15,7 @@ class PackageRepository < BaseRepository
klass Package
mapping do
+ indexes :id, type: 'keyword'
indexes :category, type: 'keyword'
indexes :name, type: 'keyword'
indexes :name_sort, type: 'keyword'
@@ -25,7 +26,13 @@ class PackageRepository < BaseRepository
indexes :license, type: 'keyword'
indexes :licenses, type: 'keyword'
indexes :herds, type: 'keyword'
- indexes :maintainers, type: 'object'
+ indexes :maintainers do
+ indexes :name, type: 'keyword'
+ indexes :description, type: 'text'
+ indexes :type, type: 'keyword'
+ indexes :restrict, type: 'keyword'
+ indexes :email, type: 'keyword'
+ end
indexes :useflags do
indexes :local do
indexes :scope, type: 'keyword'
diff --git a/app/repositories/useflag_repository.rb b/app/repositories/useflag_repository.rb
index 26328f4..a80b5f4 100644
--- a/app/repositories/useflag_repository.rb
+++ b/app/repositories/useflag_repository.rb
@@ -13,6 +13,7 @@ class UseflagRepository < BaseRepository
klass Useflag
mapping do
+ indexes :id, type: 'keyword'
indexes :name, type: 'text'
indexes :description, type: 'text'
indexes :atom, type: 'keyword'
diff --git a/app/repositories/version_repository.rb b/app/repositories/version_repository.rb
index 43168d2..e28f5e7 100644
--- a/app/repositories/version_repository.rb
+++ b/app/repositories/version_repository.rb
@@ -13,6 +13,7 @@ class VersionRepository < BaseRepository
klass Version
mapping do
+ indexes :id, type: 'keyword'
indexes :version, type: 'keyword'
indexes :package, type: 'keyword'
indexes :atom, type: 'keyword'