Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add search indexing for dataset_description DatasetType field #3035

Merged
merged 4 commits into from
May 2, 2024
Merged
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
3 changes: 2 additions & 1 deletion packages/openneuro-search/src/mappings/datasets-mapping.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@
"properties": {
"Name": { "type": "text" },
"Authors": { "type": "text" },
"SeniorAuthor": { "type": "text" }
"SeniorAuthor": { "type": "text" },
"DatasetType": { "type": "keyword" }
}
},
"readme": {
Expand Down
1 change: 1 addition & 0 deletions packages/openneuro-search/src/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export const INDEX_DATASET_FRAGMENT = gql`
Name
Authors
SeniorAuthor
DatasetType
}
summary {
tasks
Expand Down
6 changes: 6 additions & 0 deletions packages/openneuro-server/src/datalad/description.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@
newDescription.HowToAcknowledge =
JSON.stringify(description.HowToAcknowledge) || ""
}
if (
description.hasOwnProperty("DatasetType") &&
typeof description.DatasetType !== "string"

Check warning on line 93 in packages/openneuro-server/src/datalad/description.ts

View check run for this annotation

Codecov / codecov/patch

packages/openneuro-server/src/datalad/description.ts#L93

Added line #L93 was not covered by tests
) {
newDescription.DatasetType = "raw"
}

Check warning on line 96 in packages/openneuro-server/src/datalad/description.ts

View check run for this annotation

Codecov / codecov/patch

packages/openneuro-server/src/datalad/description.ts#L95-L96

Added lines #L95 - L96 were not covered by tests
return newDescription
}

Expand Down
2 changes: 2 additions & 0 deletions packages/openneuro-server/src/graphql/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,8 @@
ReferencesAndLinks: [String]
# The Document Object Identifier of the dataset (not the corresponding paper).
DatasetDOI: String
# The BIDS DatasetType field defined as "raw" or "derivative"
DatasetType: String

Check warning on line 575 in packages/openneuro-server/src/graphql/schema.ts

View check run for this annotation

Codecov / codecov/patch

packages/openneuro-server/src/graphql/schema.ts#L574-L575

Added lines #L574 - L575 were not covered by tests
# List of ethics committee approvals of the research protocols and/or protocol identifiers.
EthicsApprovals: [String]
}
Expand Down
Loading