Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

publishingCountry parameter added https://github.com/gbif/literature-… #46

Merged
merged 1 commit into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -145,6 +146,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
Loading