From 5684a6308573c3fe73f981676b81e3e6822bfb6c Mon Sep 17 00:00:00 2001 From: Al Niessner Date: Tue, 1 Aug 2023 10:11:59 -0700 Subject: [PATCH] set tracking the hits to true --- .../pds/api/registry/search/SearchRequestFactory.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/service/src/main/java/gov/nasa/pds/api/registry/search/SearchRequestFactory.java b/service/src/main/java/gov/nasa/pds/api/registry/search/SearchRequestFactory.java index 4cf45960..ebd39a09 100644 --- a/service/src/main/java/gov/nasa/pds/api/registry/search/SearchRequestFactory.java +++ b/service/src/main/java/gov/nasa/pds/api/registry/search/SearchRequestFactory.java @@ -103,9 +103,12 @@ public SearchRequest build(RequestBuildContext context, String index) { ProductQueryBuilderUtil.addPresetCriteria(this.base, context.getPresetCriteria()); } - return new SearchRequest().indices(index) - .source(new SearchSourceBuilder().query(this.base).fetchSource( - context.getFields().toArray(new String[0]), - SearchRequestFactory.excludes(context.getFields()))); + return new SearchRequest() + .indices(index) + .source(new SearchSourceBuilder() + .query(this.base) + .fetchSource(context.getFields().toArray(new String[0]), + SearchRequestFactory.excludes(context.getFields())) + .trackTotalHits(true)); } }