Skip to content

Commit

Permalink
rename noSupersededProduct -> excludeSupersededProducts
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdunnjpl committed Aug 1, 2024
1 parent 2b773d9 commit cc758fe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ private HashMap<String, Object> getLatestLidVid(PdsProductIdentifier identifier,
SearchRequest searchRequest = new RegistrySearchRequestBuilder(this.connectionContext)
.matchLid(identifier)
.fieldsFromStrings(fields)
.noSupersededProducts()
.excludeSupersededProducts()
.build();

// useless to detail here that the HashMap is parameterized <String, Object>
Expand Down Expand Up @@ -343,7 +343,7 @@ private PdsProductClasses resolveProductClass(PdsProductIdentifier identifier)
SearchRequest searchRequest = new RegistrySearchRequestBuilder(this.connectionContext)
.matchLid(identifier)
.fieldsFromStrings(List.of(PdsProductClasses.getPropertyName()))
.noSupersededProducts()
.excludeSupersededProducts()
.build();

SearchResponse<HashMap> searchResponse = this.openSearchClient.search(searchRequest, HashMap.class);
Expand All @@ -363,7 +363,7 @@ private PdsLidVid resolveLatestLidvid(PdsProductIdentifier identifier)
SearchRequest searchRequest = new RegistrySearchRequestBuilder(this.connectionContext)
.matchLid(identifier.getLid())
.fieldsFromStrings(List.of())
.noSupersededProducts()
.excludeSupersededProducts()
.build();

SearchResponse<HashMap> searchResponse = this.openSearchClient.search(searchRequest, HashMap.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public BoolQuery.Builder getQueryBuilder() {
* @param pageSize - the page size to use for pagination
* @param sortFieldNames - the fields by which results are sorted (ascending), from highest to lowest priority
* @param searchAfterFieldValues - the values corresponding to the sort fields, for pagination
* @param noSupersededProducts - whether to exclude superseded products from the result set
* @param excludeSupersededProducts - whether to exclude superseded products from the result set
*/
public RegistrySearchRequestBuilder applyMultipleProductsDefaults(
List<String> includeFieldNames,
Expand All @@ -124,16 +124,16 @@ public RegistrySearchRequestBuilder applyMultipleProductsDefaults(
Integer pageSize,
List<String> sortFieldNames,
List<String> searchAfterFieldValues,
Boolean noSupersededProducts
Boolean excludeSupersededProducts
) throws UnparsableQParamException, SortSearchAfterMismatchException {
this
.fieldsFromStrings(includeFieldNames)
.constrainByQueryString(queryString)
.addKeywordsParam(keywords)
.paginate(pageSize, sortFieldNames, searchAfterFieldValues);

if (noSupersededProducts) {
this.noSupersededProducts();
if (excludeSupersededProducts) {
this.excludeSupersededProducts();
}

return this;
Expand Down Expand Up @@ -358,7 +358,7 @@ public RegistrySearchRequestBuilder addKeywordsParam(List<String> keywords) {
* N.B. this does *not* mean the latest version which satisfies other constraints, so application of this constraint
* can result in no hits being returned despite valid results existing.
*/
public RegistrySearchRequestBuilder noSupersededProducts() {
public RegistrySearchRequestBuilder excludeSupersededProducts() {

ExistsQuery supersededByExists = new ExistsQuery.Builder()
.field("ops:Provenance/ops:superseded_by")
Expand Down

0 comments on commit cc758fe

Please sign in to comment.