From ca997ba9f7b60df0cb85eb6da056c5aacc3e3777 Mon Sep 17 00:00:00 2001 From: Stig Norland Date: Wed, 20 Nov 2024 11:28:16 +0100 Subject: [PATCH 1/2] total_fields.limit = 1100 (#609) --- indexing-handlers/src/main/resources/resource_settings.json | 5 +++++ search-commons/src/test/resources/resource_settings_dev.json | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/indexing-handlers/src/main/resources/resource_settings.json b/indexing-handlers/src/main/resources/resource_settings.json index f50e0d7dd..8eb7b7697 100644 --- a/indexing-handlers/src/main/resources/resource_settings.json +++ b/indexing-handlers/src/main/resources/resource_settings.json @@ -1,4 +1,9 @@ { + "mapping": { + "total_fields": { + "limit": "1100" + } + }, "analysis": { "char_filter": { "quote": { diff --git a/search-commons/src/test/resources/resource_settings_dev.json b/search-commons/src/test/resources/resource_settings_dev.json index f50e0d7dd..8eb7b7697 100644 --- a/search-commons/src/test/resources/resource_settings_dev.json +++ b/search-commons/src/test/resources/resource_settings_dev.json @@ -1,4 +1,9 @@ { + "mapping": { + "total_fields": { + "limit": "1100" + } + }, "analysis": { "char_filter": { "quote": { From 16964c62f7ec4dcfb2de3805e41691734961af47 Mon Sep 17 00:00:00 2001 From: Vestad Date: Wed, 20 Nov 2024 14:28:39 +0100 Subject: [PATCH 2/2] New response model (#608) * New response model * Pr feedback --- .../search/resource/response/Affiliation.java | 12 ++++++ .../search/resource/response/Contributor.java | 25 +++++++++++ .../search/resource/response/Identity.java | 15 +++++++ .../resource/response/OtherIdentifiers.java | 23 ++++++++++ .../resource/response/PublicationDate.java | 15 +++++++ .../resource/response/PublishingDetails.java | 21 +++++++++ .../resource/response/RecordMetadata.java | 18 ++++++++ .../response/ResourceSearchResponse.java | 43 +++++++++++++++++++ .../nva/search/resource/response/Series.java | 12 ++++++ 9 files changed, 184 insertions(+) create mode 100644 search-commons/src/main/java/no/unit/nva/search/resource/response/Affiliation.java create mode 100644 search-commons/src/main/java/no/unit/nva/search/resource/response/Contributor.java create mode 100644 search-commons/src/main/java/no/unit/nva/search/resource/response/Identity.java create mode 100644 search-commons/src/main/java/no/unit/nva/search/resource/response/OtherIdentifiers.java create mode 100644 search-commons/src/main/java/no/unit/nva/search/resource/response/PublicationDate.java create mode 100644 search-commons/src/main/java/no/unit/nva/search/resource/response/PublishingDetails.java create mode 100644 search-commons/src/main/java/no/unit/nva/search/resource/response/RecordMetadata.java create mode 100644 search-commons/src/main/java/no/unit/nva/search/resource/response/ResourceSearchResponse.java create mode 100644 search-commons/src/main/java/no/unit/nva/search/resource/response/Series.java diff --git a/search-commons/src/main/java/no/unit/nva/search/resource/response/Affiliation.java b/search-commons/src/main/java/no/unit/nva/search/resource/response/Affiliation.java new file mode 100644 index 000000000..24b72b2e2 --- /dev/null +++ b/search-commons/src/main/java/no/unit/nva/search/resource/response/Affiliation.java @@ -0,0 +1,12 @@ +package no.unit.nva.search.resource.response; + +import com.fasterxml.jackson.annotation.JsonProperty; + +class Affiliation { + + @JsonProperty("id") + private String id; + + @JsonProperty("type") + private String type; +} diff --git a/search-commons/src/main/java/no/unit/nva/search/resource/response/Contributor.java b/search-commons/src/main/java/no/unit/nva/search/resource/response/Contributor.java new file mode 100644 index 000000000..28c968350 --- /dev/null +++ b/search-commons/src/main/java/no/unit/nva/search/resource/response/Contributor.java @@ -0,0 +1,25 @@ +package no.unit.nva.search.resource.response; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +class Contributor { + + @JsonProperty("affiliations") + private List affiliations; + + @JsonProperty("correspondingAuthor") + private boolean correspondingAuthor; + + @JsonProperty("identity") + private Identity identity; + + @JsonProperty("role") + private String role; + + @JsonProperty("sequence") + private int sequence; + + @JsonProperty("type") + private String type; +} diff --git a/search-commons/src/main/java/no/unit/nva/search/resource/response/Identity.java b/search-commons/src/main/java/no/unit/nva/search/resource/response/Identity.java new file mode 100644 index 000000000..931a5005f --- /dev/null +++ b/search-commons/src/main/java/no/unit/nva/search/resource/response/Identity.java @@ -0,0 +1,15 @@ +package no.unit.nva.search.resource.response; + +import com.fasterxml.jackson.annotation.JsonProperty; + +class Identity { + + @JsonProperty("id") + private String id; + + @JsonProperty("type") + private String type; + + @JsonProperty("name") + private String name; +} diff --git a/search-commons/src/main/java/no/unit/nva/search/resource/response/OtherIdentifiers.java b/search-commons/src/main/java/no/unit/nva/search/resource/response/OtherIdentifiers.java new file mode 100644 index 000000000..2171e7ce2 --- /dev/null +++ b/search-commons/src/main/java/no/unit/nva/search/resource/response/OtherIdentifiers.java @@ -0,0 +1,23 @@ +package no.unit.nva.search.resource.response; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +public class OtherIdentifiers { + + @JsonProperty("scopus") + private List scopus; + + @JsonProperty("cristin") + private List cristin; + + @JsonProperty("handle") + private List handle; + + @JsonProperty("issn") + private List issn; + + @JsonProperty("isbn") + private List isbn; + +} diff --git a/search-commons/src/main/java/no/unit/nva/search/resource/response/PublicationDate.java b/search-commons/src/main/java/no/unit/nva/search/resource/response/PublicationDate.java new file mode 100644 index 000000000..25ede8ce4 --- /dev/null +++ b/search-commons/src/main/java/no/unit/nva/search/resource/response/PublicationDate.java @@ -0,0 +1,15 @@ +package no.unit.nva.search.resource.response; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class PublicationDate { + + @JsonProperty("year") + private String year; + @JsonProperty("month") + private String month; + + @JsonProperty("day") + private String day; + +} diff --git a/search-commons/src/main/java/no/unit/nva/search/resource/response/PublishingDetails.java b/search-commons/src/main/java/no/unit/nva/search/resource/response/PublishingDetails.java new file mode 100644 index 000000000..89f8d45bc --- /dev/null +++ b/search-commons/src/main/java/no/unit/nva/search/resource/response/PublishingDetails.java @@ -0,0 +1,21 @@ +package no.unit.nva.search.resource.response; + +import com.fasterxml.jackson.annotation.JsonProperty; + +class PublishingDetails { + + @JsonProperty("id") + private String id; + + @JsonProperty("type") + private String type; + + @JsonProperty("series") + private Series series; + + @JsonProperty("name") + private String name; + + @JsonProperty("doi") + private String doi; +} diff --git a/search-commons/src/main/java/no/unit/nva/search/resource/response/RecordMetadata.java b/search-commons/src/main/java/no/unit/nva/search/resource/response/RecordMetadata.java new file mode 100644 index 000000000..4679bdc47 --- /dev/null +++ b/search-commons/src/main/java/no/unit/nva/search/resource/response/RecordMetadata.java @@ -0,0 +1,18 @@ +package no.unit.nva.search.resource.response; + +import com.fasterxml.jackson.annotation.JsonProperty; + +class RecordMetadata { + + @JsonProperty("status") + private String status; + + @JsonProperty("createdDate") + private String createdDate; + + @JsonProperty("modifiedDate") + private String modifiedDate; + + @JsonProperty("publishedDate") + private String publishedDate; +} diff --git a/search-commons/src/main/java/no/unit/nva/search/resource/response/ResourceSearchResponse.java b/search-commons/src/main/java/no/unit/nva/search/resource/response/ResourceSearchResponse.java new file mode 100644 index 000000000..26966db31 --- /dev/null +++ b/search-commons/src/main/java/no/unit/nva/search/resource/response/ResourceSearchResponse.java @@ -0,0 +1,43 @@ +package no.unit.nva.search.resource.response; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +public class ResourceSearchResponse { + + @JsonProperty("id") + private String id; + + @JsonProperty("type") + private String type; + + @JsonProperty("otherIdentifiers") + private OtherIdentifiers otherIdentifiers; + + @JsonProperty("recordMetadata") + private RecordMetadata recordMetadata; + + @JsonProperty("mainTitle") + private String mainTitle; + + @JsonProperty("abstract") + private String mainLanguageAbstract; + + @JsonProperty("description") + private String description; + + @JsonProperty("alternativeTitles") + private List alternativeTitles; + + @JsonProperty("publicationDate") + private PublicationDate publicationDate; + + @JsonProperty("contributorsPreview") + private List contributorsPreview; + + @JsonProperty("contributorsCount") + private int contributorsCount; + + @JsonProperty("publishingDetails") + private PublishingDetails publishingDetails; +} diff --git a/search-commons/src/main/java/no/unit/nva/search/resource/response/Series.java b/search-commons/src/main/java/no/unit/nva/search/resource/response/Series.java new file mode 100644 index 000000000..81a868f93 --- /dev/null +++ b/search-commons/src/main/java/no/unit/nva/search/resource/response/Series.java @@ -0,0 +1,12 @@ +package no.unit.nva.search.resource.response; + +import com.fasterxml.jackson.annotation.JsonProperty; + +class Series { + + @JsonProperty("id") + private String id; + + @JsonProperty("name") + private String name; +}