diff --git a/common/search/src/test/resources/ImagesIndexConfig.json b/common/search/src/test/resources/ImagesIndexConfig.json index 7c037e817..34770f48e 100644 --- a/common/search/src/test/resources/ImagesIndexConfig.json +++ b/common/search/src/test/resources/ImagesIndexConfig.json @@ -158,7 +158,7 @@ "properties": { "features": { "type": "dense_vector", - "dims": 2048, + "dims": 4096, "index": true, "similarity": "cosine" }, diff --git a/common/search/src/test/resources/test_documents/images.examples.color-filter-tests.blue-foot.json b/common/search/src/test/resources/test_documents/images.examples.color-filter-tests.blue-foot.json index 7389571a5..a45466697 100644 --- a/common/search/src/test/resources/test_documents/images.examples.color-filter-tests.blue-foot.json +++ b/common/search/src/test/resources/test_documents/images.examples.color-filter-tests.blue-foot.json @@ -280,25 +280,67 @@ }, "aggregatableValues": { "locations.license": [ - "{\"id\":\"cc-by\",\"label\":\"Attribution 4.0 International (CC BY 4.0)\",\"url\":\"http://creativecommons.org/licenses/by/4.0/\",\"type\":\"License\"}" + { + "id": "cc-by", + "label": "Attribution 4.0 International (CC BY 4.0)" + } ], - "source.contributors.agent.label": [ - "{\"id\":\"wmqhmq5g\",\"label\":\"David Linstead\",\"type\":\"Agent\"}" + "source.contributors.agent": [ + { + "id": "wmqhmq5g", + "label": "David Linstead" + } ], - "source.genres.label": [], - "source.subjects.label": [ - "{\"label\":\"Specimen\",\"concepts\":[],\"type\":\"Subject\"}", - "{\"label\":\"Structure\",\"concepts\":[],\"type\":\"Subject\"}", - "{\"label\":\"Morphology\",\"concepts\":[],\"type\":\"Subject\"}", - "{\"label\":\"Dye\",\"concepts\":[],\"type\":\"Subject\"}", - "{\"label\":\"Feet\",\"concepts\":[],\"type\":\"Subject\"}", - "{\"label\":\"Sole\",\"concepts\":[],\"type\":\"Subject\"}", - "{\"label\":\"Sweat duct\",\"concepts\":[],\"type\":\"Subject\"}", - "{\"label\":\"Spiral\",\"concepts\":[],\"type\":\"Subject\"}", - "{\"label\":\"Monkey\",\"concepts\":[],\"type\":\"Subject\"}", - "{\"label\":\"Red\",\"concepts\":[],\"type\":\"Subject\"}", - "{\"label\":\"Yellow\",\"concepts\":[],\"type\":\"Subject\"}", - "{\"label\":\"Blue\",\"concepts\":[],\"type\":\"Subject\"}" + "source.genres": [], + "source.subjects": [ + { + "id": "ygx6gn7w", + "label": "Specimen" + }, + { + "id": "fgybpuea", + "label": "Structure" + }, + { + "id": "fxgxwdfq", + "label": "Morphology" + }, + { + "id": "hc4ja8jh", + "label": "Dye" + }, + { + "id": "wa25ujm4", + "label": "Feet" + }, + { + "id": "aqzhyyfm", + "label": "Sole" + }, + { + "id": "gqnrzssm", + "label": "Sweat duct" + }, + { + "id": "zvy2exwb", + "label": "Spiral" + }, + { + "id": "x73v2qnu", + "label": "Monkey" + }, + { + "id": "pg4pfxze", + "label": "Red" + }, + { + "id": "gmg9ew4m", + "label": "Yellow" + }, + { + "id": "us4p6zsw", + "label": "Blue" + } ] }, "filterableValues": { diff --git a/common/search/src/test/resources/test_documents/images.examples.color-filter-tests.blue.json b/common/search/src/test/resources/test_documents/images.examples.color-filter-tests.blue.json index 8856dc61b..0bccd4aaa 100644 --- a/common/search/src/test/resources/test_documents/images.examples.color-filter-tests.blue.json +++ b/common/search/src/test/resources/test_documents/images.examples.color-filter-tests.blue.json @@ -254,23 +254,50 @@ }, "aggregatableValues": { "locations.license": [ - "{\"id\":\"cc-by\",\"label\":\"Attribution 4.0 International (CC BY 4.0)\",\"url\":\"http://creativecommons.org/licenses/by/4.0/\",\"type\":\"License\"}" + { + "id": "cc-by", + "label": "Attribution 4.0 International (CC BY 4.0)" + } ], - "source.contributors.agent.label": [ - "{\"id\":\"wmqhmq5g\",\"label\":\"David Linstead\",\"type\":\"Agent\"}" + "source.contributors.agent": [ + { + "id": "wmqhmq5g", + "label": "David Linstead" + } ], - "source.genres.label": [], - "source.subjects.label": [ - "{\"label\":\"Specimen\",\"concepts\":[],\"type\":\"Subject\"}", - "{\"label\":\"Structure\",\"concepts\":[],\"type\":\"Subject\"}", - "{\"label\":\"Morphology\",\"concepts\":[],\"type\":\"Subject\"}", - "{\"label\":\"Dye\",\"concepts\":[],\"type\":\"Subject\"}", - "{\"label\":\"Herbivore\",\"concepts\":[],\"type\":\"Subject\"}", - "{\"label\":\"Blue\",\"concepts\":[],\"type\":\"Subject\"}", - "{\"label\":\"Black\",\"concepts\":[],\"type\":\"Subject\"}", - "{\"label\":\"Lines\",\"concepts\":[],\"type\":\"Subject\"}", - "{\"label\":\"Yellow\",\"concepts\":[],\"type\":\"Subject\"}", - "{\"label\":\"Green\",\"concepts\":[],\"type\":\"Subject\"}" + "source.genres": [], + "source.subjects": [ + { + "id": "ygx6gn7w", + "label": "Specimen" + }, { + "id": "fgybpuea", + "label": "Structure" + }, { + "id": "fxgxwdfq", + "label": "Morphology" + }, { + "id": "hc4ja8jh", + "label": "Dye" + }, { + "id": "z8uu9bnz", + "label": "Herbivore" + }, { + "id": "us4p6zsw", + "label": "Blue" + }, { + "id": "asj4hhdn", + "label": "Black" + }, { + "id": "qd6mgsd7", + "label": "Lines" + }, { + "id": "gmg9ew4m", + "label": "Yellow" + }, { + "id": "bqv39tft", + "label": "Green" + } ] }, "filterableValues": { diff --git a/common/search/src/test/resources/test_documents/images.examples.color-filter-tests.even-less-blue-foot.json b/common/search/src/test/resources/test_documents/images.examples.color-filter-tests.even-less-blue-foot.json index a40797ee8..88a1c97fa 100644 --- a/common/search/src/test/resources/test_documents/images.examples.color-filter-tests.even-less-blue-foot.json +++ b/common/search/src/test/resources/test_documents/images.examples.color-filter-tests.even-less-blue-foot.json @@ -169,15 +169,27 @@ }, "aggregatableValues": { "locations.license": [ - "{\"id\":\"pdm\",\"label\":\"Public Domain Mark\",\"url\":\"https://creativecommons.org/share-your-work/public-domain/pdm/\",\"type\":\"License\"}" + { + "id": "pdm", + "label": "Public Domain Mark" + } ], - "source.contributors.agent.label": [], - "source.genres.label": [ - "{\"label\":\"Gouaches\",\"concepts\":[],\"type\":\"Genre\"}", - "{\"label\":\"Paintings\",\"concepts\":[],\"type\":\"Genre\"}" + "source.contributors.agent": [], + "source.genres": [ + { + "id": "rs4dpxyv", + "label": "Gouaches" + }, + { + "id": "q9b2ep5v", + "label": "Paintings" + } ], - "source.subjects.label": [ - "{\"label\":\"Yoga\",\"concepts\":[],\"type\":\"Subject\"}" + "source.subjects": [ + { + "id": "wku5d45h", + "label": "Yoga" + } ] }, "filterableValues": { diff --git a/common/search/src/test/resources/test_documents/images.examples.color-filter-tests.even-less-red.json b/common/search/src/test/resources/test_documents/images.examples.color-filter-tests.even-less-red.json index b8154ef19..f0ed36eb7 100644 --- a/common/search/src/test/resources/test_documents/images.examples.color-filter-tests.even-less-red.json +++ b/common/search/src/test/resources/test_documents/images.examples.color-filter-tests.even-less-red.json @@ -232,18 +232,36 @@ }, "aggregatableValues": { "locations.license": [ - "{\"id\":\"inc\",\"label\":\"In copyright\",\"url\":\"http://rightsstatements.org/vocab/InC/1.0/\",\"type\":\"License\"}" + { + "id": "inc", + "label": "In copyright" + } ], - "source.contributors.agent.label": [ - "{\"id\":\"vmxx4ee7\",\"label\":\"Mead Johnson International\",\"type\":\"Organisation\"}" + "source.contributors.agent": [ + { + "id": "vmxx4ee7", + "label": "Mead Johnson International" + } ], - "source.genres.label": [ - "{\"label\":\"Ephemera\",\"concepts\":[],\"type\":\"Genre\"}" + "source.genres": [ + { + "id": "ucmbnwkq", + "label": "Ephemera" + } ], - "source.subjects.label": [ - "{\"label\":\"Infant Formula\",\"concepts\":[],\"type\":\"Subject\"}", - "{\"label\":\"Bottle Feeding\",\"concepts\":[],\"type\":\"Subject\"}", - "{\"label\":\"Mexico\",\"concepts\":[],\"type\":\"Subject\"}" + "source.subjects": [ + { + "id": "xap87fpw", + "label": "Infant Formula" + }, + { + "id": "yqg6f6vf", + "label": "Bottle Feeding" + }, + { + "id": "gwjttuaz", + "label": "Mexico" + } ] }, "filterableValues": { diff --git a/common/search/src/test/resources/test_documents/images.examples.color-filter-tests.orange-foot.json b/common/search/src/test/resources/test_documents/images.examples.color-filter-tests.orange-foot.json index 936ce9f7c..714a53b66 100644 --- a/common/search/src/test/resources/test_documents/images.examples.color-filter-tests.orange-foot.json +++ b/common/search/src/test/resources/test_documents/images.examples.color-filter-tests.orange-foot.json @@ -241,19 +241,40 @@ }, "aggregatableValues": { "locations.license": [ - "{\"id\":\"inc\",\"label\":\"In copyright\",\"url\":\"http://rightsstatements.org/vocab/InC/1.0/\",\"type\":\"License\"}" + { + "id": "inc", + "label": "In copyright" + } ], - "source.contributors.agent.label": [ - "{\"id\":\"e23yasdv\",\"label\":\"C. & J. Clark Ltd\",\"type\":\"Organisation\"}" + "source.contributors.agent": [ + { + "id": "e23yasdv", + "label": "C. & J. Clark Ltd" + } ], - "source.genres.label": [ - "{\"label\":\"Ephemera\",\"concepts\":[],\"type\":\"Genre\"}", - "{\"label\":\"Posters\",\"concepts\":[],\"type\":\"Genre\"}" + "source.genres": [ + { + "id": "ucmbnwkq", + "label": "Ephemera" + }, + { + "id": "whcsuusy", + "label": "Posters" + } ], - "source.subjects.label": [ - "{\"label\":\"Shoes\",\"concepts\":[],\"type\":\"Subject\"}", - "{\"label\":\"Foot\",\"concepts\":[],\"type\":\"Subject\"}", - "{\"label\":\"Child Development\",\"concepts\":[],\"type\":\"Subject\"}" + "source.subjects": [ + { + "id": "tjwt533n", + "label": "Shoes" + }, + { + "id": "ukm9xsds", + "label": "Foot" + }, + { + "id": "y2dazdgp", + "label": "Child Development" + } ] }, "filterableValues": { diff --git a/common/search/src/test/resources/test_documents/images.examples.color-filter-tests.red.json b/common/search/src/test/resources/test_documents/images.examples.color-filter-tests.red.json index e41ea0a25..f07761754 100644 --- a/common/search/src/test/resources/test_documents/images.examples.color-filter-tests.red.json +++ b/common/search/src/test/resources/test_documents/images.examples.color-filter-tests.red.json @@ -241,22 +241,55 @@ }, "aggregatableValues": { "locations.license": [ - "{\"id\":\"cc-by\",\"label\":\"Attribution 4.0 International (CC BY 4.0)\",\"url\":\"http://creativecommons.org/licenses/by/4.0/\",\"type\":\"License\"}" + { + "id": "cc-by", + "label": "Attribution 4.0 International (CC BY 4.0)" + } ], - "source.contributors.agent.label": [ - "{\"id\":\"d9u9jqys\",\"label\":\"Dr. Caroline Pope and William Parish, University of Bristol\",\"type\":\"Agent\"}" + "source.contributors.agent": [ + { + "id": "d9u9jqys", + "label": "Dr. Caroline Pope and William Parish, University of Bristol" + } ], - "source.genres.label": [], - "source.subjects.label": [ - "{\"label\":\"Glassware\",\"concepts\":[],\"type\":\"Subject\"}", - "{\"label\":\"Conical flask\",\"concepts\":[],\"type\":\"Subject\"}", - "{\"label\":\"Measuring cylinder\",\"concepts\":[],\"type\":\"Subject\"}", - "{\"label\":\"Experiment\",\"concepts\":[],\"type\":\"Subject\"}", - "{\"label\":\"Heat\",\"concepts\":[],\"type\":\"Subject\"}", - "{\"label\":\"Red\",\"concepts\":[],\"type\":\"Subject\"}", - "{\"label\":\"Yellow\",\"concepts\":[],\"type\":\"Subject\"}", - "{\"label\":\"White\",\"concepts\":[],\"type\":\"Subject\"}", - "{\"label\":\"Black\",\"concepts\":[],\"type\":\"Subject\"}" + "source.genres": [], + "source.subjects": [ + { + "id": "s2vfajqb", + "label": "Glassware" + }, + { + "id": "duc2b442", + "label": "Conical flask" + }, + { + "id": "zbh2g54f", + "label": "Measuring cylinder" + }, + { + "id": "nuh2cqeu", + "label": "Experiment" + }, + { + "id": "q95qxgqd", + "label": "Heat" + }, + { + "id": "pg4pfxze", + "label": "Red" + }, + { + "id": "gmg9ew4m", + "label": "Yellow" + }, + { + "id": "p2bcbxnc", + "label": "White" + }, + { + "id": "asj4hhdn", + "label": "Black" + } ] }, "filterableValues": { diff --git a/common/search/src/test/resources/test_documents/images.examples.color-filter-tests.slightly-less-blue-foot.json b/common/search/src/test/resources/test_documents/images.examples.color-filter-tests.slightly-less-blue-foot.json index 2022b40e6..73f213bf8 100644 --- a/common/search/src/test/resources/test_documents/images.examples.color-filter-tests.slightly-less-blue-foot.json +++ b/common/search/src/test/resources/test_documents/images.examples.color-filter-tests.slightly-less-blue-foot.json @@ -230,17 +230,35 @@ }, "aggregatableValues": { "locations.license": [ - "{\"id\":\"inc\",\"label\":\"In copyright\",\"url\":\"http://rightsstatements.org/vocab/InC/1.0/\",\"type\":\"License\"}" + { + "id": "inc", + "label": "In copyright" + } ], - "source.contributors.agent.label": [], - "source.genres.label": [ - "{\"label\":\"Posters\",\"concepts\":[],\"type\":\"Genre\"}", - "{\"label\":\"Lithographs\",\"concepts\":[],\"type\":\"Genre\"}" + "source.contributors.agent": [], + "source.genres": [ + { + "id": "whcsuusy", + "label": "Posters" + }, + { + "id": "fmydsuw2", + "label": "Lithographs" + } ], - "source.subjects.label": [ - "{\"label\":\"Diabetes\",\"concepts\":[],\"type\":\"Subject\"}", - "{\"label\":\"Mycetoma\",\"concepts\":[],\"type\":\"Subject\"}", - "{\"label\":\"Kenya\",\"concepts\":[],\"type\":\"Subject\"}" + "source.subjects": [ + { + "id": "pjhy9w6d", + "label": "Diabetes" + }, + { + "id": "wqqmkzb3", + "label": "Mycetoma" + }, + { + "id": "fjshhu4m", + "label": "Kenya" + } ] }, "filterableValues": { diff --git a/common/search/src/test/resources/test_documents/images.examples.color-filter-tests.slightly-less-red.json b/common/search/src/test/resources/test_documents/images.examples.color-filter-tests.slightly-less-red.json index 841d73a4f..41852bab0 100644 --- a/common/search/src/test/resources/test_documents/images.examples.color-filter-tests.slightly-less-red.json +++ b/common/search/src/test/resources/test_documents/images.examples.color-filter-tests.slightly-less-red.json @@ -340,26 +340,68 @@ }, "aggregatableValues": { "locations.license": [ - "{\"id\":\"inc\",\"label\":\"In copyright\",\"url\":\"http://rightsstatements.org/vocab/InC/1.0/\",\"type\":\"License\"}" + { + "id": "inc", + "label": "In copyright" + } ], - "source.contributors.agent.label": [ - "{\"id\":\"ms5vu5e6\",\"label\":\"North Warwickshire NHS Trust. Health Promotion Service\",\"type\":\"Organisation\"}" + "source.contributors.agent": [ + { + "id": "ms5vu5e6", + "label": "North Warwickshire NHS Trust. Health Promotion Service" + } ], - "source.genres.label": [ - "{\"label\":\"Ephemera\",\"concepts\":[],\"type\":\"Genre\"}", - "{\"label\":\"Leaflets\",\"concepts\":[],\"type\":\"Genre\"}" + "source.genres": [ + { + "id": "ucmbnwkq", + "label": "Ephemera" + }, + { + "id": "h7ke4a5n", + "label": "Leaflets" + } ], - "source.subjects.label": [ - "{\"label\":\"HIV\",\"concepts\":[],\"type\":\"Subject\"}", - "{\"label\":\"HIV Seropositivity - transmission\",\"concepts\":[],\"type\":\"Subject\"}", - "{\"label\":\"Acquired Immunodeficiency Syndrome\",\"concepts\":[],\"type\":\"Subject\"}", - "{\"label\":\"Safe Sex\",\"concepts\":[],\"type\":\"Subject\"}", - "{\"label\":\"Condoms\",\"concepts\":[],\"type\":\"Subject\"}", - "{\"label\":\"Substance Abuse, Intravenous\",\"concepts\":[],\"type\":\"Subject\"}", - "{\"label\":\"AIDS Serodiagnosis\",\"concepts\":[],\"type\":\"Subject\"}", - "{\"label\":\"Nuneaton (England)\",\"concepts\":[],\"type\":\"Subject\"}", - "{\"label\":\"Bedworth (England)\",\"concepts\":[],\"type\":\"Subject\"}", - "{\"label\":\"Warwickshire (England)\",\"concepts\":[],\"type\":\"Subject\"}" + "source.subjects": [ + { + "id": "hfwwn7yb", + "label": "HIV" + }, + { + "id": "bjdva9jf", + "label": "HIV Seropositivity - transmission" + }, + { + "id": "exgkgv7u", + "label": "Acquired Immunodeficiency Syndrome" + }, + { + "id": "xtqcfe8k", + "label": "Safe Sex" + }, + { + "id": "frhjttus", + "label": "Condoms" + }, + { + "id": "b5hajr4w", + "label": "Substance Abuse, Intravenous" + }, + { + "id": "w5zscyh9", + "label": "AIDS Serodiagnosis" + }, + { + "id": "by72mxnu", + "label": "Nuneaton (England)" + }, + { + "id": "qxxszr8p", + "label": "Bedworth (England)" + }, + { + "id": "q35z5xss", + "label": "Warwickshire (England)" + } ] }, "filterableValues": { diff --git a/common/search/src/test/resources/test_documents/images.similar-features.0.json b/common/search/src/test/resources/test_documents/images.similar-features.0.json index 6a7f4fc10..435682f38 100644 --- a/common/search/src/test/resources/test_documents/images.similar-features.0.json +++ b/common/search/src/test/resources/test_documents/images.similar-features.0.json @@ -188,17 +188,32 @@ }, "aggregatableValues": { "locations.license": [ - "{\"id\":\"pdm\",\"label\":\"Public Domain Mark\",\"url\":\"https://creativecommons.org/share-your-work/public-domain/pdm/\",\"type\":\"License\"}" + { + "id": "pdm", + "label": "Public Domain Mark" + } ], - "source.contributors.agent.label": [ - "{\"id\":\"hxzteya7\",\"label\":\"Robinson, W. R\",\"type\":\"Person\"}" + "source.contributors.agent": [ + { + "id": "hxzteya7", + "label": "Robinson, W. R" + } ], - "source.genres.label": [ - "{\"label\":\"Etchings\",\"concepts\":[],\"type\":\"Genre\"}" + "source.genres": [ + { + "id": "yfqryj26", + "label": "Etchings" + } ], - "source.subjects.label": [ - "{\"label\":\"Hospitals\",\"concepts\":[],\"type\":\"Subject\"}", - "{\"label\":\"Richmond (Yorkshire, England)\",\"concepts\":[],\"type\":\"Subject\"}" + "source.subjects": [ + { + "id": "rz2yv25k", + "label": "Hospitals" + }, + { + "id": "wf35jybw", + "label": "Richmond (Yorkshire, England)" + } ] }, "filterableValues": { diff --git a/common/search/src/test/resources/test_documents/images.similar-features.1.json b/common/search/src/test/resources/test_documents/images.similar-features.1.json index db8ae6b38..ab9cfed9c 100644 --- a/common/search/src/test/resources/test_documents/images.similar-features.1.json +++ b/common/search/src/test/resources/test_documents/images.similar-features.1.json @@ -228,18 +228,39 @@ }, "aggregatableValues": { "locations.license": [], - "source.contributors.agent.label": [ - "{\"id\":\"hb43zca4\",\"label\":\"Wright, Thomas, 1810-1877\",\"type\":\"Person\"}", - "{\"id\":\"wnvpundv\",\"label\":\"Jones, H. Longueville (Harry Longueville), 1806-1870\",\"type\":\"Person\"}", - "{\"id\":\"vcmxn47e\",\"label\":\"Le Keux, John, 1783-1846\",\"type\":\"Person\"}" + "source.contributors.agent": [ + { + "id": "hb43zca4", + "label": "Wright, Thomas, 1810-1877" + }, + { + "id": "wnvpundv", + "label": "Jones, H. Longueville (Harry Longueville), 1806-1870" + }, + { + "id": "vcmxn47e", + "label": "Le Keux, John, 1783-1846" + } ], - "source.genres.label": [ - "{\"label\":\"Viewbooks\",\"concepts\":[],\"type\":\"Genre\"}" + "source.genres": [ + { + "id": "gwr26qnc", + "label": "Viewbooks" + } ], - "source.subjects.label": [ - "{\"label\":\"Architecture - history\",\"concepts\":[],\"type\":\"Subject\"}", - "{\"label\":\"Cambridge (England)\",\"concepts\":[],\"type\":\"Subject\"}", - "{\"label\":\"University of Cambridge\",\"concepts\":[],\"type\":\"Subject\"}" + "source.subjects": [ + { + "id": "a282jy98", + "label": "Architecture - history" + }, + { + "id": "ppd9r5dq", + "label": "Cambridge (England)" + }, + { + "id": "f5jq6btt", + "label": "University of Cambridge" + } ] }, "filterableValues": { diff --git a/common/search/src/test/resources/test_documents/images.similar-features.2.json b/common/search/src/test/resources/test_documents/images.similar-features.2.json index 26ee8153b..dae32ab56 100644 --- a/common/search/src/test/resources/test_documents/images.similar-features.2.json +++ b/common/search/src/test/resources/test_documents/images.similar-features.2.json @@ -201,18 +201,36 @@ }, "aggregatableValues": { "locations.license": [ - "{\"id\":\"pdm\",\"label\":\"Public Domain Mark\",\"url\":\"https://creativecommons.org/share-your-work/public-domain/pdm/\",\"type\":\"License\"}" + { + "id": "pdm", + "label": "Public Domain Mark" + } ], - "source.contributors.agent.label": [ - "{\"id\":\"xff2rber\",\"label\":\"Lambert, J., active 1812-1851\",\"type\":\"Person\"}" + "source.contributors.agent": [ + { + "id": "xff2rber", + "label": "Lambert, J., active 1812-1851" + } ], - "source.genres.label": [ - "{\"label\":\"Engravings\",\"concepts\":[],\"type\":\"Genre\"}" + "source.genres": [ + { + "id": "xff2rber", + "label": "Engravings" + } ], - "source.subjects.label": [ - "{\"label\":\"Hospitals\",\"concepts\":[],\"type\":\"Subject\"}", - "{\"label\":\"Schools\",\"concepts\":[],\"type\":\"Subject\"}", - "{\"label\":\"Christ's Hospital (London, England)\",\"concepts\":[],\"type\":\"Subject\"}" + "source.subjects": [ + { + "id": "rz2yv25k", + "label": "Hospitals" + }, + { + "id": "c264c59j", + "label": "Schools" + }, + { + "id": "wyzywkvq", + "label": "Christ's Hospital (London, England)" + } ] }, "filterableValues": { diff --git a/common/search/src/test/resources/test_documents/images.similar-features.3.json b/common/search/src/test/resources/test_documents/images.similar-features.3.json index cce4fcfca..ae6c02949 100644 --- a/common/search/src/test/resources/test_documents/images.similar-features.3.json +++ b/common/search/src/test/resources/test_documents/images.similar-features.3.json @@ -204,18 +204,36 @@ }, "aggregatableValues": { "locations.license": [ - "{\"id\":\"pdm\",\"label\":\"Public Domain Mark\",\"url\":\"https://creativecommons.org/share-your-work/public-domain/pdm/\",\"type\":\"License\"}" + { + "id": "pdm", + "label": "Public Domain Mark" + } ], - "source.contributors.agent.label": [ - "{\"id\":\"gp5j27t8\",\"label\":\"Tappen, George, approximately 1771-1830\",\"type\":\"Person\"}" + "source.contributors.agent": [ + { + "id": "gp5j27t8", + "label": "Tappen, George, approximately 1771-1830" + } ], - "source.genres.label": [ - "{\"label\":\"Etchings\",\"concepts\":[],\"type\":\"Genre\"}" + "source.genres": [ + { + "id": "yfqryj26", + "label": "Etchings" + } ], - "source.subjects.label": [ - "{\"label\":\"Asylums\",\"concepts\":[],\"type\":\"Subject\"}", - "{\"label\":\"London (England)\",\"concepts\":[],\"type\":\"Subject\"}", - "{\"label\":\"Royal Caledonian Asylum (London, England)\",\"concepts\":[],\"type\":\"Subject\"}" + "source.subjects": [ + { + "id": "n5ktsbcb", + "label": "Asylums" + }, + { + "id": "a7gmt7ff", + "label": "London (England)" + }, + { + "id": "vwekvhjq", + "label": "Royal Caledonian Asylum (London, England)" + } ] }, "filterableValues": { diff --git a/common/search/src/test/resources/test_documents/images.similar-features.4.json b/common/search/src/test/resources/test_documents/images.similar-features.4.json index 565710dc2..512c297d7 100644 --- a/common/search/src/test/resources/test_documents/images.similar-features.4.json +++ b/common/search/src/test/resources/test_documents/images.similar-features.4.json @@ -225,19 +225,40 @@ }, "aggregatableValues": { "locations.license": [ - "{\"id\":\"pdm\",\"label\":\"Public Domain Mark\",\"url\":\"https://creativecommons.org/share-your-work/public-domain/pdm/\",\"type\":\"License\"}" + { + "id": "pdm", + "label": "Public Domain Mark" + } ], - "source.contributors.agent.label": [ - "{\"id\":\"wzs8agfx\",\"label\":\"Jobbins, John Richard, active 1839-1864\",\"type\":\"Person\"}", - "{\"id\":\"qwmdm7rg\",\"label\":\"Green, James, 1781-1849\",\"type\":\"Person\"}" + "source.contributors.agent": [ + { + "id": "wzs8agfx", + "label": "Jobbins, John Richard, active 1839-1864" + }, + { + "id": "qwmdm7rg", + "label": "Green, James, 1781-1849" + } ], - "source.genres.label": [ - "{\"label\":\"Lithographs\",\"concepts\":[],\"type\":\"Genre\"}" + "source.genres": [ + { + "id": "fmydsuw2", + "label": "Lithographs" + } ], - "source.subjects.label": [ - "{\"label\":\"Hospitals - England - 19th century\",\"concepts\":[],\"type\":\"Subject\"}", - "{\"label\":\"Accrington (England)\",\"concepts\":[],\"type\":\"Subject\"}", - "{\"label\":\"Peel Institution (Accrington, England)\",\"concepts\":[],\"type\":\"Subject\"}" + "source.subjects": [ + { + "id": "rz2yv25k", + "label": "Hospitals - England - 19th century" + }, + { + "id": "jaek4vgf", + "label": "Accrington (England)" + }, + { + "id": "twghfmqm", + "label": "Peel Institution (Accrington, England)" + } ] }, "filterableValues": { diff --git a/common/search/src/test/resources/test_documents/images.similar-features.5.json b/common/search/src/test/resources/test_documents/images.similar-features.5.json index 1c3bac131..977443740 100644 --- a/common/search/src/test/resources/test_documents/images.similar-features.5.json +++ b/common/search/src/test/resources/test_documents/images.similar-features.5.json @@ -192,16 +192,31 @@ }, "aggregatableValues": { "locations.license": [ - "{\"id\":\"pdm\",\"label\":\"Public Domain Mark\",\"url\":\"https://creativecommons.org/share-your-work/public-domain/pdm/\",\"type\":\"License\"}" + { + "id": "pdm", + "label": "Public Domain Mark" + } ], - "source.contributors.agent.label": [], - "source.genres.label": [ - "{\"label\":\"Wood engravings\",\"concepts\":[],\"type\":\"Genre\"}" + "source.contributors.agent": [], + "source.genres": [ + { + "id": "hjzzh4gd", + "label": "Wood engravings" + } ], - "source.subjects.label": [ - "{\"label\":\"Holloway (England)\",\"concepts\":[],\"type\":\"Subject\"}", - "{\"label\":\"Nightingale, Florence, 1820-1910 Homes and haunts\",\"concepts\":[],\"type\":\"Subject\"}", - "{\"label\":\"Lea Hurst (England)\",\"concepts\":[],\"type\":\"Subject\"}" + "source.subjects": [ + { + "id": "fe2ppnsv", + "label": "Holloway (England)" + }, + { + "id": "gk2eca5r", + "label": "Nightingale, Florence, 1820-1910 Homes and haunts" + }, + { + "id": "mt2usfy2", + "label": "Lea Hurst (England)" + } ] }, "filterableValues": { diff --git a/common/search/src/test/scala/weco/api/search/fixtures/TestDocumentFixtures.scala b/common/search/src/test/scala/weco/api/search/fixtures/TestDocumentFixtures.scala index 7ceeeece6..4f3945483 100644 --- a/common/search/src/test/scala/weco/api/search/fixtures/TestDocumentFixtures.scala +++ b/common/search/src/test/scala/weco/api/search/fixtures/TestDocumentFixtures.scala @@ -103,6 +103,7 @@ trait TestDocumentFixtures // With a large number of works this can take a long time // 30 seconds should be enough whenReady(result, Timeout(Span(30, Seconds))) { _ => + println(result) getSizeOf(index) shouldBe documents.size } } diff --git a/search/src/main/scala/weco/api/search/elasticsearch/ElasticsearchService.scala b/search/src/main/scala/weco/api/search/elasticsearch/ElasticsearchService.scala index 5beaed8dc..747cff712 100644 --- a/search/src/main/scala/weco/api/search/elasticsearch/ElasticsearchService.scala +++ b/search/src/main/scala/weco/api/search/elasticsearch/ElasticsearchService.scala @@ -85,6 +85,7 @@ class ElasticsearchService(elasticClient: ElasticClient)(implicit .map(_.toEither) .map { case Right(response) => + println(response) transaction.setLabel("elasticTook", response.took) Right(response) @@ -184,3 +185,4 @@ class ElasticsearchService(elasticClient: ElasticClient)(implicit ) } } + diff --git a/search/src/main/scala/weco/api/search/models/Aggregation.scala b/search/src/main/scala/weco/api/search/models/Aggregation.scala index 1154bf1d5..d81d069c7 100644 --- a/search/src/main/scala/weco/api/search/models/Aggregation.scala +++ b/search/src/main/scala/weco/api/search/models/Aggregation.scala @@ -60,7 +60,8 @@ object AggregationMapping { def aggregationParser( jsonString: String - ): Try[Aggregation] = + ): Try[Aggregation] = { + println(jsonString) parse(jsonString) .map(bucketsFromAnywhere) .toTry @@ -90,6 +91,7 @@ object AggregationMapping { ) }) .map(buckets => Aggregation(buckets.toList)) + } } diff --git a/search/src/main/scala/weco/api/search/services/WorksRequestBuilder.scala b/search/src/main/scala/weco/api/search/services/WorksRequestBuilder.scala index d19931021..128e2eabb 100644 --- a/search/src/main/scala/weco/api/search/services/WorksRequestBuilder.scala +++ b/search/src/main/scala/weco/api/search/services/WorksRequestBuilder.scala @@ -72,12 +72,12 @@ object WorksRequestBuilder filterToQuery = buildWorkFilterQuery ) - /** - * Each aggregatable field is indexed as a nested field with an `id` value and a `label` value. All aggregations - * are `id`-based, with a `label`-based sub-aggregation to get Elasticsearch to return all `label` values associated - * with each `id` bucket. (Usually each `id` value only has one one `label` value associated with it, but not always. - * For example, different Works can use different labels for a given LoC Subject Heading.) - */ + + /** Each aggregatable field is indexed as a nested field with an `id` value and a `label` value. All aggregations + * are `id`-based, with a `label`-based sub-aggregation to get Elasticsearch to return all `label` values associated + * with each `id` bucket. (Usually each `id` value only has one one `label` value associated with it, but not always. + * For example, different Works can use different labels for a given LoC Subject Heading.) + */ private def toIdBasedAggregation( aggregationName: String, nestedFieldPath: String, @@ -88,7 +88,9 @@ object WorksRequestBuilder .field(s"$nestedFieldPath.id") .subAggregations(termsAgg("labels", s"$nestedFieldPath.label").size(1)) - @deprecated("This method is included for backward compatibility reasons and will be removed soon.", "25-10-2024") +// @deprecated( +// "This method is included for backward compatibility reasons and will be removed soon.", +// "25-10-2024") private def toLegacyAggregation( aggregationName: String, aggregatedFieldPath: String, @@ -129,7 +131,8 @@ object WorksRequestBuilder toIdBasedAggregation( "languages", "aggregatableValues.languages", - size = 200) + size = 200 + ) // Note: we want these aggregations to return every possible value, so we // want this to be as many licenses as we support in the catalogue pipeline. @@ -156,12 +159,11 @@ object WorksRequestBuilder ) } - private def dateOrder( - implicit - searchOptions: WorkSearchOptions): Option[SortingOrder] = - searchOptions.sortBy collectFirst { - case ProductionDateSortRequest => - searchOptions.sortOrder + private def dateOrder(implicit + searchOptions: WorkSearchOptions + ): Option[SortingOrder] = + searchOptions.sortBy collectFirst { case ProductionDateSortRequest => + searchOptions.sortOrder } val buildWorkFilterQuery: PartialFunction[WorkFilter, Query] = {