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

Update vespa test schema #75

Merged
merged 1 commit into from
Aug 21, 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 src/cpr_sdk/version.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
_MAJOR = "1"
_MINOR = "1"
_PATCH = "9"
_PATCH = "10"
_SUFFIX = ""

VERSION_SHORT = "{0}.{1}".format(_MAJOR, _MINOR)
Expand Down
2 changes: 1 addition & 1 deletion tests/local_vespa/docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
84 changes: 70 additions & 14 deletions tests/local_vespa/test_app/schemas/family_document.sd
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ schema family_document {
attribute: fast-search
}

field family_geographies type array<string> {
indexing: attribute | summary
attribute: fast-search
}

field family_source type string {
indexing: attribute | summary
attribute: fast-search
Expand All @@ -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
}
Expand All @@ -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<metadata_item> {
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 {}
Expand Down Expand Up @@ -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<string> {}
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 {}
}
}
82 changes: 79 additions & 3 deletions tests/local_vespa/test_documents/family_document.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down Expand Up @@ -793,7 +795,21 @@
"family_publication_year": 2020,
"family_publication_ts": "2020-12-01T00:00:00+00:00",
"family_description_index": "<p><span style=\"font-size: 10pt;font-family: Arial;\">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.</span></p>",
"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"
}
]
}
},
{
Expand All @@ -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",
Expand Down Expand Up @@ -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.<br><br><br><br>",
"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"
}
]
}
},
{
Expand All @@ -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",
Expand Down Expand Up @@ -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.<br><br>&nbsp;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"
}
]
}
}
]
Loading