Skip to content

Commit 258d3fa

Browse files
committed
search: updates facets/aggregation
Signed-off-by: Pamfilos Fokianos <[email protected]>
1 parent 4c5533d commit 258d3fa

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

cap/config.py

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,24 @@ def _(x):
374374
},
375375
'meta': {'title': 'SM Analysis Characteristics'},
376376
},
377+
'facet_measurement_type': {
378+
'terms': {
379+
'field': 'general.measurement_type' # noqa
380+
},
381+
'meta': {'title': 'Measurement type'},
382+
},
383+
'facet_power_mW': {
384+
'terms': {
385+
'field': 'beamline_parameters.laser_parameters.power_mW' # noqa
386+
},
387+
'meta': {'title': 'Power (in mw)'},
388+
},
389+
'facet_isotope': {
390+
'terms': {
391+
'field': 'general.isotope' # noqa
392+
},
393+
'meta': {'title': 'Isotope'},
394+
},
377395
'facet_interpretation': {
378396
'terms': {
379397
'size': 30,
@@ -402,6 +420,18 @@ def _(x):
402420
},
403421
'meta': {'title': 'Next Deadline Date', 'type': 'range'},
404422
},
423+
"facet_year": {
424+
"terms": {
425+
"field": "general.year"
426+
},
427+
'meta': {'title': 'Data Taking Year'},
428+
},
429+
"facet_wavelength_nm": {
430+
"terms": {
431+
"field": "beamline_parameters.laser_parameters.wavelength_nm"
432+
},
433+
'meta': {'title': 'wavelength_nm'},
434+
},
405435
"facet_target_date": {
406436
"date_histogram": {
407437
"field": "initial.target_date",
@@ -457,6 +487,7 @@ def _(x):
457487
format='yyyy',
458488
end_date_math='/y',
459489
),
490+
'year': terms_filter('general.year'),
460491
"target_date": range_filter(
461492
'initial.target_date',
462493
format='yyyy-MM-dd',
@@ -480,6 +511,16 @@ def _(x):
480511
'interpretation': terms_filter(
481512
'basic_info.analysis_keywords.interpretation.keyword'
482513
),
514+
'measurement_type': terms_filter(
515+
'general.measurement_type'
516+
),
517+
'power_mW': terms_filter(
518+
'beamline_parameters.laser_parameters.power_mW'
519+
),
520+
'isotope': terms_filter(
521+
'general.isotope'
522+
),
523+
'wavelength': terms_filter("beamline_parameters.laser_parameters.wavelength_nm"),
483524
'further_search_categorisation': terms_filter(
484525
'basic_info.analysis_keywords.further_search_categorisation.keyword'
485526
), # noqa

tests/integration/deposits/test_get_deposits.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,12 +416,17 @@ def test_get_deposits_with_facets(env_config, client, users, auth_headers_for_us
416416
'facet_further_search_categorisation',
417417
'facet_further_search_categorisation_heavy_ion',
418418
'facet_interpretation',
419+
'facet_isotope',
420+
'facet_measurement_type',
419421
'facet_next_deadline_date',
420422
'facet_physics_theme',
423+
'facet_power_mW',
421424
'facet_sm_analysis_characteristics',
422425
'facet_stage',
423426
'facet_target_date',
427+
'facet_wavelength_nm',
424428
'facet_collection',
429+
'facet_year',
425430
'particles',
426431
]
427432
)

0 commit comments

Comments
 (0)