Skip to content

Commit

Permalink
Merge pull request #674 from microbiomedata/issue-654
Browse files Browse the repository at this point in the history
Add indexes to `alldocs` collection for `has_input` and `has_output` keys/slots
  • Loading branch information
sujaypatil96 authored Sep 12, 2024
2 parents 564f79a + 04d3d80 commit d3742a5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions nmdc_runtime/site/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -1043,6 +1043,10 @@ def materialize_alldocs(context) -> int:

# Re-idx for `alldocs` collection
mdb.alldocs.create_index("id", unique=True)
# The indexes were added to improve the performance of the
# /data_objects/study/{study_id} endpoint
mdb.alldocs.create_index("has_input")
mdb.alldocs.create_index("has_output")
context.log.info(
f"refreshed {mdb.alldocs} collection with {mdb.alldocs.estimated_document_count()} docs."
)
Expand Down

0 comments on commit d3742a5

Please sign in to comment.