Skip to content

Commit

Permalink
Merge pull request #46 from gbif/40-publishing-country
Browse files Browse the repository at this point in the history
publishingCountry parameter added https://github.com/gbif/literature-…
  • Loading branch information
ahakanzn authored Oct 22, 2024
2 parents bc22784 + 8b02ddf commit e389bff
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<swagger-annotations.version>2.2.0</swagger-annotations.version>
<super-csv.version>2.4.0</super-csv.version>

<gbif-api.version>1.16.10</gbif-api.version>
<gbif-api.version>1.16.10-SNAPSHOT</gbif-api.version>
<gbif-common-ws.version>1.27</gbif-common-ws.version>

<spring-cloud-openfeign.version>2.2.6.RELEASE</spring-cloud-openfeign.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,14 @@ public LiteratureResource(LiteratureSearchService searchService) {
array = @ArraySchema(schema = @Schema(implementation = UUID.class)),
in = ParameterIn.QUERY,
explode = Explode.TRUE),
@Parameter(
name = "publishingCountry",
description = "Country of the publisher whose dataset is referenced in publication. Country codes are listed in our "
+ "[Country enum](https://api.gbif.org/v1/enumeration/country)."
+ REPEATED,
array = @ArraySchema(schema = @Schema(implementation = Country.class)),
in = ParameterIn.QUERY,
explode = Explode.TRUE),
@Parameter(
name = "relevance",
description =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public class LiteratureEsFieldMapper implements EsFieldMapper<LiteratureSearchPa
.put(LiteratureSearchParameter.TOPICS, "topics")
.put(LiteratureSearchParameter.GBIF_DATASET_KEY, "gbifDatasetKey")
.put(LiteratureSearchParameter.PUBLISHING_ORGANIZATION_KEY, "publishingOrganizationKey")
.put(LiteratureSearchParameter.PUBLISHING_COUNTRY, "publishingCountry")
.put(LiteratureSearchParameter.PUBLISHER, "publisher")
.put(LiteratureSearchParameter.SOURCE, "source")
.put(LiteratureSearchParameter.PEER_REVIEW, "peerReview")
Expand Down Expand Up @@ -183,6 +184,7 @@ public String[] getMappedFields() {
"gbifRegion",
"gbifDatasetKey",
"publishingOrganizationKey",
"publishingCountry",
"gbifTaxonKey",
"gbifOccurrenceKey",
"gbifHigherTaxonKey",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ public LiteratureSearchResult toSearchResult(SearchHit searchHit) {
getDateValue(fields, "updatedAt").ifPresent(result::setModified);
getListValue(fields, "websites").ifPresent(result::setWebsites);
getIntegerValue(fields, "year").ifPresent(result::setYear);
getCountrySetValue(fields, "publishingCountry").ifPresent(result::setPublishingCountry);

return result;
}
Expand Down

0 comments on commit e389bff

Please sign in to comment.