From 7cca27c5e99d76ff4e24f60b4261d2e5f83c759e Mon Sep 17 00:00:00 2001 From: thomas loubrieu Date: Fri, 24 Feb 2023 12:29:28 -0800 Subject: [PATCH 1/2] exclude not found case for 500 error on multiple lidvids returns when 1 is expected --- .../pds/api/registry/model/RequestAndResponseContext.java | 2 +- service/src/main/resources/application.properties | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/service/src/main/java/gov/nasa/pds/api/registry/model/RequestAndResponseContext.java b/service/src/main/java/gov/nasa/pds/api/registry/model/RequestAndResponseContext.java index 3f2e1784..e10fd027 100644 --- a/service/src/main/java/gov/nasa/pds/api/registry/model/RequestAndResponseContext.java +++ b/service/src/main/java/gov/nasa/pds/api/registry/model/RequestAndResponseContext.java @@ -357,7 +357,7 @@ public void setResponse(RestHighLevelClient client, SearchRequest request) throw long hitCount = hits.getTotalHits().value; if (hitCount == 1L) { this.formatters.get(this.format).setResponse(hits.getAt(0), this.fields); - } else { + } else if (hitCount > 1L) { String basicErrMsg = "Got " + hitCount + " hits for a query which should have returned a singular result. " + "Is provenance metadata present and up-to-date?"; diff --git a/service/src/main/resources/application.properties b/service/src/main/resources/application.properties index 858a17ae..6dcb4025 100644 --- a/service/src/main/resources/application.properties +++ b/service/src/main/resources/application.properties @@ -1,6 +1,6 @@ springfox.documentation.swagger.v2.path=/api-docs server.contextPath=/ -server.port=8080 +server.port=8081 server.forward-headers-strategy=framework #spring.jackson.date-format=io.swagger.RFC3339DateFormat @@ -18,7 +18,7 @@ server.ssl.key-store=classpath:keystore.p12 server.ssl.key-store-type=PKCS12 # note the port is mandatory even when it is default :80 or :443 -openSearch.host=localhost:9200 +openSearch.host=elasticsearch:9200 openSearch.registryIndex=registry openSearch.registryRefIndex=registry-refs openSearch.timeOutSeconds=60 From c37c7186228cc3457e149da74f8b1388e2f84764 Mon Sep 17 00:00:00 2001 From: thomas loubrieu Date: Thu, 2 Mar 2023 10:32:22 -0800 Subject: [PATCH 2/2] remove local configuration which should not have been pushed in the first place --- service/src/main/resources/application.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/service/src/main/resources/application.properties b/service/src/main/resources/application.properties index 6dcb4025..858a17ae 100644 --- a/service/src/main/resources/application.properties +++ b/service/src/main/resources/application.properties @@ -1,6 +1,6 @@ springfox.documentation.swagger.v2.path=/api-docs server.contextPath=/ -server.port=8081 +server.port=8080 server.forward-headers-strategy=framework #spring.jackson.date-format=io.swagger.RFC3339DateFormat @@ -18,7 +18,7 @@ server.ssl.key-store=classpath:keystore.p12 server.ssl.key-store-type=PKCS12 # note the port is mandatory even when it is default :80 or :443 -openSearch.host=elasticsearch:9200 +openSearch.host=localhost:9200 openSearch.registryIndex=registry openSearch.registryRefIndex=registry-refs openSearch.timeOutSeconds=60