diff --git a/src/cpr_sdk/version.py b/src/cpr_sdk/version.py index 98cd443..850f722 100644 --- a/src/cpr_sdk/version.py +++ b/src/cpr_sdk/version.py @@ -1,6 +1,6 @@ _MAJOR = "1" _MINOR = "1" -_PATCH = "9" +_PATCH = "10" _SUFFIX = "" VERSION_SHORT = "{0}.{1}".format(_MAJOR, _MINOR) diff --git a/tests/local_vespa/docker-compose.dev.yml b/tests/local_vespa/docker-compose.dev.yml index d8740a1..2b2e567 100644 --- a/tests/local_vespa/docker-compose.dev.yml +++ b/tests/local_vespa/docker-compose.dev.yml @@ -1,7 +1,7 @@ version: "3.7" services: vespadaltest: - image: vespaengine/vespa:8.273.20 + image: vespaengine/vespa:8.396.18 container_name: vespadaltest ports: - 8080:8080 diff --git a/tests/local_vespa/test_app/schemas/family_document.sd b/tests/local_vespa/test_app/schemas/family_document.sd index 732bfd4..c64360b 100644 --- a/tests/local_vespa/test_app/schemas/family_document.sd +++ b/tests/local_vespa/test_app/schemas/family_document.sd @@ -67,6 +67,11 @@ schema family_document { attribute: fast-search } + field family_geographies type array { + indexing: attribute | summary + attribute: fast-search + } + field family_source type string { indexing: attribute | summary attribute: fast-search @@ -76,6 +81,11 @@ schema family_document { indexing: summary | attribute } + field document_title type string { + indexing: summary | attribute + attribute: fast-search + } + field document_slug type string { indexing: summary | attribute } @@ -100,6 +110,45 @@ schema family_document { field document_source_url type string { indexing: summary | attribute } + + field corpus_import_id type string { + indexing: summary | attribute + attribute: fast-search + + } + + field corpus_type_name type string { + indexing: summary | attribute + attribute: fast-search + } + + field collection_title type string { + indexing: summary | attribute + attribute: fast-search + } + + field collection_summary type string { + indexing: summary | attribute + attribute: fast-search + } + + struct metadata_item { + field name type string {} + field value type string {} + } + + field metadata type array { + indexing: summary + + struct-field name { + indexing: attribute + attribute: fast-search + } + struct-field value { + indexing: attribute + attribute: fast-search + } + } } import field search_weights_ref.name_weight as name_weight {} @@ -152,19 +201,26 @@ schema family_document { } document-summary search_summary { - summary family_name type string {} - summary family_description type string {} - summary family_import_id type string {} - summary family_slug type string {} - summary family_category type string {} - summary family_publication_ts type string {} - summary family_geography type string {} - summary family_source type string {} - summary document_import_id type string {} - summary document_slug type string {} - summary document_languages type array {} - summary document_content_type type string {} - summary document_cdn_object type string {} - summary document_source_url type string {} + summary family_name {} + summary family_description {} + summary family_import_id {} + summary family_slug {} + summary family_category {} + summary family_publication_ts {} + summary family_geography {} + summary family_geographies {} + summary family_source {} + summary document_import_id {} + summary document_title {} + summary document_slug {} + summary document_languages {} + summary document_content_type {} + summary document_cdn_object {} + summary document_source_url {} + summary metadata {} + summary corpus_import_id {} + summary corpus_type_name {} + summary collection_title {} + summary collection_summary {} } } diff --git a/tests/local_vespa/test_documents/family_document.json b/tests/local_vespa/test_documents/family_document.json index 0644cb3..1f6259e 100644 --- a/tests/local_vespa/test_documents/family_document.json +++ b/tests/local_vespa/test_documents/family_document.json @@ -5,10 +5,12 @@ "family_source": "CCLW", "search_weights_ref": "id:doc_search:search_weights::default_weights", "family_name": "Climate Change Adaptation and Low Emissions Growth Strategy by 2035", + "document_title": "Climate Change Adaptation and Low Emissions Growth Strategy by 2035", "document_content_type": "text/html", "family_slug": "climate-change-adaptation-and-low-emissions-growth-strategy-by-2035_75e3", "document_source_url": "https://unfccc.int/sites/default/files/resource/ENG_CC%20adaptation%20and%20Low%20emission%20development%20Strategy%20BiH%202020-2030.pdf", "family_geography": "BIH", + "family_geographies": ["BIH"], "family_category": "Executive", "family_name_index": "Climate Change Adaptation and Low Emissions Growth Strategy by 2035", "document_languages": [ @@ -793,7 +795,21 @@ "family_publication_year": 2020, "family_publication_ts": "2020-12-01T00:00:00+00:00", "family_description_index": "

This strategy upgrades the 2013 strategy on Climate Change Adaptation. It identifies six priority sectors for climate change adaptation action, namely agriculture, water management/water resources, forestry and forest resources, biodiversity and sensitive ecosystems, tourism, human health, and energy, and six priority sectors for low emissions growth, namely electricity generation, building and housing, transport, agriculture, forestry and waste. It summarises the key impacts of climate change in BiH, and outlines strategies for the transformation of BiH to a green economy, focusing on social inclusivity and gender equity.

", - "family_import_id": "CCLW.family.i00000003.n0000" + "family_import_id": "CCLW.family.i00000003.n0000", + "corpus_import_id": "CCLW.corpus.i00000003.n0000", + "corpus_type_name": "UNFCCC Submissions", + "collection_title": "collection one", + "collection_summary": "Sample collection used for tests", + "metadata": [ + { + "name": "sector", + "value": "Price" + }, + { + "name": "sector", + "value": "Government" + } + ] } }, { @@ -802,10 +818,12 @@ "family_source": "CCLW", "search_weights_ref": "id:doc_search:search_weights::default_weights", "family_name": "Environmental Strategy for 2014-2023", + "document_title": "Environmental Strategy for 2014-2023", "document_content_type": "application/pdf", "family_slug": "environmental-strategy-for-2014-2023_9f8e", "document_source_url": "https://wedocs.unep.org/bitstream/handle/20.500.11822/9507/-Environmental_Strategy_for_the_years_2014-2023-2014Moldova_EnvironmentalStrategy_2014-202.pdf?sequence=3&isAllowed=y", "family_geography": "MDA", + "family_geographies": ["MDA"], "family_category": "Executive", "document_md5_sum": "bea7a05dae73fbbd629e687a71a15b95", "family_name_index": "Environmental Strategy for 2014-2023", @@ -1592,7 +1610,29 @@ "family_publication_ts": "2014-04-24T00:00:00+00:00", "family_description_index": "The Environment Strategy for Moldova for 2014-2023 was adopted by the Moldovan Government via decision No. 301 of 24.04.2014. The second of the strategy's key objectives includes the integration of \"environmental protection, sustainable development, and green economy principles, of climate change adaptation principles into all sectors of the national economy\". The strategy includes an emissions reduction target of 20% by 2020 and sets out a number of actions with regard to the institutional management of environmental matters and knowledge dissemination activities.



", "document_cdn_object": "MDA/2014/environmental-strategy-for-2014-2023_bea7a05dae73fbbd629e687a71a15b95.pdf", - "family_import_id": "CCLW.family.10014.0" + "family_import_id": "CCLW.family.10014.0", + "corpus_import_id": "CCLW.corpus.i00000003.n0001", + "corpus_type_name": "Laws and Policies", + "collection_title": "collection two", + "collection_summary": "Sample collection used for tests", + "metadata": [ + { + "name": "sector", + "value": "Price" + }, + { + "name": "sector", + "value": "Government" + }, + { + "name": "topic", + "value": "Mitigation" + }, + { + "name": "instrument", + "value": "Capacity building" + } + ] } }, { @@ -1601,10 +1641,12 @@ "family_source": "CCLW", "search_weights_ref": "id:doc_search:search_weights::default_weights", "family_name": "National Energy Policy and Energy Action Plan", + "document_title": "National Energy Policy and Energy Action Plan", "document_content_type": "application/pdf", "family_slug": "national-energy-policy-and-energy-action-plan_9262", "document_source_url": "https://climate-laws.org/rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBak1HIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--e3a24fcea601c6723c1496ba623ec1f48fcdd62d/f", "family_geography": "MHL", + "family_geographies": ["MHL"], "family_category": "Executive", "document_md5_sum": "1c1b4a82ac7f6310a6951e289f0b9f38", "family_name_index": "National Energy Policy and Energy Action Plan", @@ -2391,7 +2433,41 @@ "family_publication_ts": "2016-04-01T00:00:00+00:00", "family_description_index": "This document sets a vision of improving quality of life through clean, reliable, affordable, accessible, environmentally appropriate and sustainable energy services.

 It intends to 1) strengthen financial, policy and legislative frameworks for the energy sector, 2) supply 100% of urban households with electricity, 3) To provide 95% of rural outer atoll households with off grid electricity, 4) To provide access to modern forms of cooking to 90% of all households by 2020, 5) To make households and businesses 50% more energy efficient and government buildings 75% more energy efficient by 2020, 6) To achieve a 20% efficiency improvement in transport sector fuel use by 2020, 7) To reduce supply side energy losses from MEC by 20% by 2017, and 8) To provide 20% of power generation through indigenous renewable resources by 2020.", "document_cdn_object": "MHL/2016/national-energy-policy-and-energy-action-plan_1c1b4a82ac7f6310a6951e289f0b9f38.pdf", - "family_import_id": "CCLW.family.4934.0" + "family_import_id": "CCLW.family.4934.0", + "corpus_import_id": "CCLW.corpus.i00000003.n0001", + "corpus_type_name": "Laws and Policies", + "collection_title": "collection two", + "collection_summary": "Sample collection used for tests", + "metadata": [ + { + "name": "sector", + "value": "Price" + }, + { + "name": "sector", + "value": "Government" + }, + { + "name": "topic", + "value": "Mitigation" + }, + { + "name": "keyword", + "value": "Institutions" + }, + { + "name": "topic", + "value": "Misc" + }, + { + "name": "keyword", + "value": "Disaster Risk Management" + }, + { + "name": "instrument", + "value": "Capacity building" + } + ] } } ]