Skip to content
Open
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
5 changes: 2 additions & 3 deletions dandiapi/api/services/search/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
'published_after',
}
)
_ASSET_OPS = frozenset({'species', 'approach', 'technique', 'standard', 'file_type'})
_ASSET_OPS = frozenset({'species', 'approach', 'technique', 'file_type'})


def _annotate_latest_version_modified(queryset):
Expand Down Expand Up @@ -68,7 +68,6 @@ def _annotate_latest_published_created(queryset):
'species': '$.wasAttributedTo[*].species.name',
'approach': '$.approach[*].name',
'technique': '$.measurementTechnique[*].name',
'standard': '$.dataStandard[*].name',
}


Expand Down Expand Up @@ -178,7 +177,7 @@ def apply_search_filters(
if asset_qs is not None:
# NOTE perf: jsonb_path_exists with a runtime-built jsonpath cannot
# use the existing per-field GIN indexes; the path-scan operators
# (species/approach/technique/standard) currently sequential-scan the
# (species/approach/technique) currently sequential-scan the
# asset_search materialized view. The view is small enough today
# (~one row per asset) that this is acceptable, but if it becomes a
# hot path the fix is expression GIN indexes on each path or
Expand Down
1 change: 0 additions & 1 deletion dandiapi/api/services/search/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
'species',
'approach',
'technique',
'standard',
'file_type',
}
)
Expand Down
15 changes: 0 additions & 15 deletions dandiapi/api/tests/test_dandiset.py
Original file line number Diff line number Diff line change
Expand Up @@ -1969,21 +1969,6 @@ def test_advanced_search_technique_with_quoted_phrase(api_client):
assert _search_ids(api_client, 'technique:surgical') == {surg.identifier}


@pytest.mark.ai_generated
@pytest.mark.django_db
def test_advanced_search_standard_matches(api_client):
nwb = _seed_dandiset_with_asset(
asset_metadata={'dataStandard': [{'name': 'Neurodata Without Borders (NWB)'}]},
)
bids = _seed_dandiset_with_asset(
asset_metadata={'dataStandard': [{'name': 'Brain Imaging Data Structure (BIDS)'}]},
)
_refresh_asset_search()

assert _search_ids(api_client, 'standard:NWB') == {nwb.identifier}
assert _search_ids(api_client, 'standard:BIDS') == {bids.identifier}


@pytest.mark.ai_generated
@pytest.mark.django_db
def test_advanced_search_file_type_alias_and_mime(api_client):
Expand Down
2 changes: 1 addition & 1 deletion dandiapi/api/views/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ class DandisetQueryParameterSerializer(serializers.Serializer):
'Available operators: '
'created_before, created_after, modified_before, modified_after, '
'published_before, published_after (all take YYYY-MM-DD); '
'species, approach, technique, standard (case-insensitive '
'species, approach, technique (case-insensitive '
'substring against the corresponding asset_metadata array); '
'file_type (nwb, image, text, video — or any MIME prefix). '
'Invalid syntax returns HTTP 400 with the offending token; '
Expand Down
1 change: 0 additions & 1 deletion web/src/components/DandisetSearchField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ const operatorHelp = [
{ example: 'species:mouse', description: 'Has assets attributed to a species' },
{ example: 'approach:electrophysiology', description: 'Has assets using an approach' },
{ example: 'technique:"patch clamp"', description: 'Has assets using a measurement technique' },
{ example: 'standard:nwb', description: 'Has assets in a data standard' },
{ example: 'file_type:nwb', description: 'Has assets of a file type (nwb, image, text, video)' },
];

Expand Down
Loading