From 1fdd361dfa694dcd7407cfc23ea34ead8646fcc9 Mon Sep 17 00:00:00 2001 From: temi Date: Thu, 12 Dec 2024 06:22:38 +1100 Subject: [PATCH] project activity change trigger update of project --- .../au/org/ala/ecodata/ElasticSearchService.groovy | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/grails-app/services/au/org/ala/ecodata/ElasticSearchService.groovy b/grails-app/services/au/org/ala/ecodata/ElasticSearchService.groovy index 2722d0551..c6cee7f7c 100644 --- a/grails-app/services/au/org/ala/ecodata/ElasticSearchService.groovy +++ b/grails-app/services/au/org/ala/ecodata/ElasticSearchService.groovy @@ -111,7 +111,7 @@ class ElasticSearchService { RestHighLevelClient client ElasticSearchIndexManager indexManager def indexingTempInactive = false // can be set to true for loading of dump files, etc - def ALLOWED_DOC_TYPES = [Project.class.name, Site.class.name, Document.class.name, Activity.class.name, Record.class.name, Organisation.class.name, UserPermission.class.name, Program.class.name, Output.class.name] + def ALLOWED_DOC_TYPES = [Project.class.name, Site.class.name, Document.class.name, Activity.class.name, Record.class.name, Organisation.class.name, UserPermission.class.name, Program.class.name, Output.class.name, ProjectActivity.class.name] def DEFAULT_FACETS = 10 private static Queue _messageQueue = new ConcurrentLinkedQueue() @@ -642,6 +642,14 @@ class ElasticSearchService { indexHomePage(doc, Project.class.name) } break + case ProjectActivity.class.name: + // make sure updates to project activity updates project object. + // helps BioCollect mobile app show correct surveys. + ProjectActivity projectActivity = ProjectActivity.findByProjectActivityId(docId) + if (projectActivity?.projectId) { + indexDocType(projectActivity.projectId, Project.class.name) + } + break } }