diff --git a/NEWS.md b/NEWS.md index 7f1faa360..c37d2ffd9 100644 --- a/NEWS.md +++ b/NEWS.md @@ -27,6 +27,7 @@ * Implement Indexing of Libraries from Kafka ([MSEARCH-769](https://issues.folio.org/browse/MSEARCH-769)) * Return Unified List of Inventory Campuses in a Consortium ([MSEARCH-773](https://issues.folio.org/browse/MSEARCH-773)) * Return Unified List of Inventory Libraries in a Consortium ([MSEARCH-772](https://issues.folio.org/browse/MSEARCH-772)) +* Index, search Instance place of publication field ([MSEARCH-755](https://folio-org.atlassian.net/browse/MSEARCH-755)) ### Bug fixes * Do not delete kafka topics if collection topic is enabled ([MSEARCH-725](https://folio-org.atlassian.net/browse/MSEARCH-725)) diff --git a/src/main/resources/model/instance.json b/src/main/resources/model/instance.json index cd57246ce..adcc282c0 100644 --- a/src/main/resources/model/instance.json +++ b/src/main/resources/model/instance.json @@ -191,6 +191,9 @@ "dateOfPublication": { "index": "source", "showInResponse": [ "search", "call-number-browse" ] + }, + "place": { + "index": "standard" } } }, diff --git a/src/main/resources/swagger.api/examples/result/instanceSearchResult.yaml b/src/main/resources/swagger.api/examples/result/instanceSearchResult.yaml index c93220fc6..8951e9508 100644 --- a/src/main/resources/swagger.api/examples/result/instanceSearchResult.yaml +++ b/src/main/resources/swagger.api/examples/result/instanceSearchResult.yaml @@ -12,6 +12,7 @@ value: publication: - publisher: "Duncker und Humblot" dateOfPublication: "1976" + place: Karlsruhe staffSuppress: false discoverySuppress: false isBoundWith: false diff --git a/src/main/resources/swagger.api/schemas/dto/instance/publication.yaml b/src/main/resources/swagger.api/schemas/dto/instance/publication.yaml index f1cd69caa..6ec5838e5 100644 --- a/src/main/resources/swagger.api/schemas/dto/instance/publication.yaml +++ b/src/main/resources/swagger.api/schemas/dto/instance/publication.yaml @@ -5,4 +5,7 @@ properties: type: string dateOfPublication: description: "Date (year YYYY) of publication, distribution, etc." + type: string + place: + description: "Place of publication, distribution, etc." type: string \ No newline at end of file diff --git a/src/test/java/org/folio/search/controller/SearchByAllFieldsIT.java b/src/test/java/org/folio/search/controller/SearchByAllFieldsIT.java index 14aa4b543..feef40a3e 100644 --- a/src/test/java/org/folio/search/controller/SearchByAllFieldsIT.java +++ b/src/test/java/org/folio/search/controller/SearchByAllFieldsIT.java @@ -40,6 +40,8 @@ static void cleanUp() { "Antoniou matthew", "HD1691 .I5 1967", "Cambridge, Mass.", + "MIT Press", + "c2004", // holding field values "e3ff6133-b9a2-4d4c-a1c9-dc1867d4df19", @@ -76,7 +78,9 @@ void canSearchByAllFieldValues_positive(String cqlQuery) throws Throwable { "HD1691 .I5 1967", "Cambridge, Mass.", "2020-12-08T15:47:13.625+00:00", - "2020-12-08T15:47:13.625+0000" + "2020-12-08T15:47:13.625+0000", + "MIT Press", + "c2004" }) @ParameterizedTest(name = "[{index}] cql.allInstances='{query}', query=''{0}''") void canSearchByInstanceFieldValues_positive(String cqlQuery) throws Throwable { diff --git a/src/test/java/org/folio/search/controller/SearchInstanceIT.java b/src/test/java/org/folio/search/controller/SearchInstanceIT.java index 19bb0a3c2..98e182157 100644 --- a/src/test/java/org/folio/search/controller/SearchInstanceIT.java +++ b/src/test/java/org/folio/search/controller/SearchInstanceIT.java @@ -199,6 +199,18 @@ private static Stream testDataProvider() { arguments("publisher all {value}", "mit"), arguments("publisher all {value}", "press"), + arguments("publication.place all {value}", "cambridge"), + arguments("publication.place all {value}", "Cambridge"), + arguments("publication.place all {value}", "mass"), + arguments("publication.place all {value}", "Mass."), + arguments("publication.place any {value}", "Cambridge mass"), + arguments("publication.place all {value}", "Cambridge mass"), + arguments("publication.place = {value}", "\"Cambridge, Mass.\""), + arguments("publication.place == {value}", "Cambridge"), + arguments("publication.place ==/string {value}", "\"Cambridge, Mass.\""), + arguments("publication.place = {value}", "Cambridge, Ma*"), + arguments("publication.place = {value}", "\"*mbridge, Mass.\""), + arguments("contributors all {value}", "frank"), arguments("contributors all {value}", "Frank"), arguments("contributors all {value}", "grigoris"), diff --git a/src/test/resources/samples/instance-response-sample/instance-full-response.json b/src/test/resources/samples/instance-response-sample/instance-full-response.json index 03c6c3f04..a94e6f182 100644 --- a/src/test/resources/samples/instance-response-sample/instance-full-response.json +++ b/src/test/resources/samples/instance-response-sample/instance-full-response.json @@ -127,7 +127,8 @@ "publication": [ { "publisher": "MIT Press", - "dateOfPublication": "c2004" + "dateOfPublication": "c2004", + "place": "Cambridge, Mass. " } ], "staffSuppress": false,