Skip to content

Instantly share code, notes, and snippets.

@oubiwann
Created February 15, 2018 18:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oubiwann/aa531b6c47687d52809c39edf0992d78 to your computer and use it in GitHub Desktop.
Save oubiwann/aa531b6c47687d52809c39edf0992d78 to your computer and use it in GitHub Desktop.
diff --git a/indexer-app/src/cmr/indexer/data/elasticsearch.clj b/indexer-app/src/cmr/indexer/data/elasticsearch.clj
index c6483605e..a285edc37 100644
--- a/indexer-app/src/cmr/indexer/data/elasticsearch.clj
+++ b/indexer-app/src/cmr/indexer/data/elasticsearch.clj
@@ -51,6 +51,12 @@
(:transaction-id concept)
(map :transaction-id (:variable-associations concept))))
+(defmethod get-elastic-version :service
+ [concept]
+ (apply max
+ (:transaction-id concept)
+ (map :transaction-id (:service-associations concept))))
+
(defmethod get-elastic-version :default
[concept]
(:revision-id concept))
diff --git a/search-app/src/cmr/search/data/elastic_results_to_query_results.clj b/search-app/src/cmr/search/data/elastic_results_to_query_results.clj
index 60ec38223..2e1828750 100644
--- a/search-app/src/cmr/search/data/elastic_results_to_query_results.clj
+++ b/search-app/src/cmr/search/data/elastic_results_to_query_results.clj
@@ -10,3 +10,7 @@
(defmethod elastic-results/get-revision-id-from-elastic-result :variable
[concept-type elastic-result]
(first (get-in elastic-result [:fields :revision-id])))
+
+(defmethod elastic-results/get-revision-id-from-elastic-result :service
+ [concept-type elastic-result]
+ (first (get-in elastic-result [:fields :revision-id])))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment