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)); } }