@@ -282,9 +282,9 @@ def build_explorer_context(is_dicofdic, source, versions, filters, fields, order
282282 for source in sources :
283283 is_origin = DataSetType .IMAGE_DATA in source_data_types [source .id ]
284284 # If a field list wasn't provided, work from a default set
285- if is_origin and not len (fields ):
286- fields = source . get_attr ( for_faceting = False ). filter ( default_ui_display = True ). values_list ( 'name' ,
287- flat = True )
285+ if is_origin and not counts_only and not len (fields ):
286+ fields = [ "SeriesInstanceUID" , "StudyInstanceUID" , "collection_id" , "PatientID" , "program_name" ]
287+ logger . info ( "[STATUS] No field list provided, using default field list of: {}" . format ( fields ) )
288288 for dataset in data_sets :
289289 if dataset .data_type in source_data_types [source .id ]:
290290 set_type = dataset .get_set_name ()
@@ -2381,6 +2381,10 @@ def get_metadata_solr(filters, fields, sources, counts_only, collapse_on, record
23812381
23822382 if DataSetType .IMAGE_DATA in source_data_types [source .id ] and not counts_only :
23832383 # Get the records
2384+ if not len (fields ):
2385+ logger .warning ("[WARNING] Requesting records without a field lists results in all fields being returned, which we almost never want!" )
2386+ logger .warning ("[WARNING] Always give a precise list of fields!" )
2387+ fields = ["collection_id" , "SeriesInstanceUID" , "StudyInstanceUID" , "PatientID" , "program_name" ]
23842388 solr_result = query_solr_and_format_result ({
23852389 'collection' : source .name if not record_source else record_source .name ,
23862390 'fields' : list (fields ),
0 commit comments