From 3d45a5e5378b56deb009ad5402beaa66f9ef5757 Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Sun, 23 Sep 2018 18:07:38 +0200 Subject: [PATCH] properly index repository. datacite/datacite#336 --- app/models/client.rb | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/app/models/client.rb b/app/models/client.rb index 11936ed1e..6a4f88b22 100644 --- a/app/models/client.rb +++ b/app/models/client.rb @@ -96,14 +96,20 @@ class Client < ActiveRecord::Base repository_url: { type: :text }, repository_contacts: { type: :text }, description: { type: :text }, - certificates: { type: :object }, - types: { type: :object }, - additional_names: { type: :object }, - subjects: { type: :object }, - content_types: { type: :object }, - provider_types: { type: :object }, - keywords: { type: :object }, - software: { type: :object }, + certificates: { type: :text }, + types: { type: :text }, + additional_names: { type: :text }, + subjects: { type: :text }, + content_types: { type: :text }, + provider_types: { type: :text }, + keywords: { type: :text }, + institutions: { type: :text }, + data_accesses: { type: :text }, + data_uploads: { type: :text }, + data_upload_licenses: { type: :text }, + pid_systems: { type: :text }, + apis: { type: :text }, + software: { type: :text }, created: { type: :date }, updated: { type: :date } } @@ -136,7 +142,7 @@ def as_indexed_json(options={}) end def self.query_fields - ['symbol^10', 'name^10', 'contact_name^10', 'contact_email^10', 'domains', 'url', 'repository.software.name^3', '_all'] + ['symbol^10', 'name^10', 'contact_name^10', 'contact_email^10', 'domains', 'url', 'repository.software.name^3', 'repository.subjects.text^3', 'repository.certificates.text^3', '_all'] end def self.query_aggregations