Skip to content

Commit 552b461

Browse files
committed
-> testing fix for slow behavior
1 parent c6e25c6 commit 552b461

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

idc_collections/collex_metadata_utils.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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()
@@ -2380,6 +2380,7 @@ def get_metadata_solr(filters, fields, sources, counts_only, collapse_on, record
23802380
if not len(fields):
23812381
logger.warning("[WARNING] Requesting records without a field lists results in all fields being returned, which we almost never want!")
23822382
logger.warning("[WARNING] Always give a precise list of fields!")
2383+
fields = ["collection_id", "SeriesInstanceUID", "StudyInstanceUID", "PatientID", "program_name"]
23832384
solr_result = query_solr_and_format_result({
23842385
'collection': source.name if not record_source else record_source.name,
23852386
'fields': list(fields),

0 commit comments

Comments
 (0)