diff --git a/cernopendata/config.py b/cernopendata/config.py index fcfaa0f..a9b253a 100644 --- a/cernopendata/config.py +++ b/cernopendata/config.py @@ -355,11 +355,12 @@ def _query_parser_and(qstr=None): ) else: _query = dsl.Q() - if ( - request.values.get("ondemand") != "true" - and request.values.get("ondemand") != "ondemand" - ): - _query = _query & ~dsl.Q("match", **{"distribution.availability": "ondemand"}) + + # if ( + # request.values.get("ondemand") != "true" + # and request.values.get("ondemand") != "ondemand" + # ): + # _query = _query & ~dsl.Q("match", **{"distribution.availability": "ondemand"}) return _query @@ -478,6 +479,7 @@ def _query_parser_and(qstr=None): ), ), experiment=dict(terms=dict(field="experiment", order=dict(_key="asc"))), + availability=dict(terms=dict(field="availability")), year=dict( terms=dict(field="date_created", size=70, order=dict(_key="asc")) ), @@ -526,6 +528,7 @@ def _query_parser_and(qstr=None): keywords=dict(terms=dict(field="keywords", order=dict(_key="asc"))), ), "post_filters": dict( + availability=terms_filter("availability"), type=nested_filter("type.primary", "type.secondary"), experiment=terms_filter("experiment"), year=terms_filter("date_created"), diff --git a/cernopendata/modules/fixtures/data/terms/terms.json b/cernopendata/modules/fixtures/data/terms/terms.json index f98dce3..4e97421 100644 --- a/cernopendata/modules/fixtures/data/terms/terms.json +++ b/cernopendata/modules/fixtures/data/terms/terms.json @@ -34,6 +34,17 @@ "primary": "Glossary" } }, + { + "anchor": "Availability", + "category": "generic", + "definition": "In order to optimize storage costs, some of the datasets are stored on tape. These datasets are not available immediately from the web portal, and they have to be requested in advance. Some datasets offer some sample files, and keep the bulk of the data on tape. The three options for availability are: online (files can be accessed immediately), sample files (some files from the dataset can be accessible immediately), ondemand (the dataset has to be requested before it could be accessed). The instructions on how to request a dataset are explained in the relevant records", + "term": [ + "Availability" + ], + "type": { + "primary": "Glossary" + } + }, { "anchor": "Barn", "category": "generic", diff --git a/cernopendata/modules/theme/assets/semantic-ui/js/search/components/Facets.js b/cernopendata/modules/theme/assets/semantic-ui/js/search/components/Facets.js index ddbf308..9d1685d 100644 --- a/cernopendata/modules/theme/assets/semantic-ui/js/search/components/Facets.js +++ b/cernopendata/modules/theme/assets/semantic-ui/js/search/components/Facets.js @@ -39,11 +39,6 @@ const CODFacets = ({ aggs, updateQueryState, currentQueryState }) => {
- {aggs.map((agg) => ( ))} diff --git a/docker-compose-dev.yml b/docker-compose-dev.yml index f1e0ab8..f28d585 100644 --- a/docker-compose-dev.yml +++ b/docker-compose-dev.yml @@ -35,6 +35,7 @@ services: - WDB_NO_BROWSER_AUTO_OPEN=True volumes: - ./:/code/ + - ../opendata.cern.ch:/content/ web-files: profiles: