Skip to content
Open
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
78 changes: 78 additions & 0 deletions sparc-metadata-elasticsearch/map-core-competency-searches.md
Original file line number Diff line number Diff line change
Expand Up @@ -317,3 +317,81 @@ https://scicrunch.org/api/1/elastic/SPARC_PortalDatasets_dev/_search?api_key=###
}, ...
```


## Get a list of organs for species

This search looks for a dataset by title.

### POST

```yaml
https://scicrunch.org/api/1/elastic/SPARC_PortalDatasets_dev/_search?api_key=####
```

### JSON Body Example

```yaml
{
"from": 0,
"size": 0,
"query": {
"query_string": {
"fields": [
"*species.name"
],
"query": "human"
}
},
"aggregations": {
"organ": {
"composite": {
"sources": [
{"id": {"terms": {"field": "anatomy.organ.curie.aggregate"}}},
{"name": {"terms": {"field": "anatomy.organ.name.aggregate"}}}
],
"size": 200
}
}
}
}

```

### Result

```yaml
{
"took": 13,
"timed_out": false,
"_shards": {
"total": 2,
"successful": 2,
"skipped": 0,
"failed": 0
},
"hits": {
"total": 13,
"max_score": 0.0,
"hits": []
},
"aggregations": {
"organ": {
"after_key": {
"id": "uberon:0002048",
"name": "lung"
},
"buckets": [
{
"key": {
"id": "uberon:0000945",
"name": "stomach"
},
"doc_count": 1
},
{
"key": {
"id": "uberon:0000948",
"name": "heart"
},
"doc_count": 1
}, ...