LogoLogo
  • API Service Gateway Overview
    • Introduction
    • Getting Started with the APIs
    • Using your API key
    • API Rate Limiting
    • API Service Gateway Responses
  • Elasticsearch Metadata Services
    • Resource Information Network (RIN) Services
      • Research Resource Identifiers
      • The RRID Resolver
      • Searching RIN Indices
      • Basic RIN Search Examples
      • RIN Elaticsearch JSON Data Model
      • Download Larger Datasets
    • SPARC Datasets
      • Searching SPARC Dataset Indices
      • Basic SPARC Search Examples
      • SPARC Dataset Elasticsearch JSON Data Model
  • Terminology Services
    • InterLex
      • Searching InterLex
      • Basic Interlex Search Example
      • Bulk Add
      • Bulk Update
Powered by GitBook
On this page
  • Introduction
  • Access to the RIN APIs
  • Elasticsearch Pass-Through
  • Elasticsearch Pass-Through
  • RIN Index Aliases
Edit on GitHub
Export as PDF
  1. Elasticsearch Metadata Services
  2. Resource Information Network (RIN) Services

Searching RIN Indices

Introduction to searching the RIN indices

PreviousThe RRID ResolverNextBasic RIN Search Examples

Last updated 3 months ago

Introduction

The Resources Information Network (RIN) APIs are provided via an ElasticSearch endpoint. Simple URL based searches are available via the GET method. More complex queries can be supplied via the POST method.

Access to the RIN APIs

Access to the RIN API is provided via an Elasticsearch pass-through.

Elasticsearch Pass-Through

POST https://api.scicrunch.io/elastic/v1/{index}/_search

The pass-through is accessible at https://scicrunch.org/api/1/elastic. Similar to standard Elasticsearch APIs you must then supply an index and an action. In this case the index, the type and the search command (_search). Documentation on the Elasticsearch Search API is available at

Path Parameters

Name
Type
Description

index*

String

Production RIN index

Headers

Name
Type
Description

apikey*

String

Your API key to access the services

Request Body

Name
Type
Description

data

String

JSON query body

{
    "took": 23,
    "timed_out": false,
    "_shards": {
        "total": 2,
        "successful": 2,
        "skipped": 0,
        "failed": 0
    },
    "hits": {...}
}
{
    "error": {
        "root_cause": [
            {
                "type": "security_exception",
                "reason": "action [indices:data/read/search] requires authentication",
                "header": {
                    "WWW-Authenticate": [
                        "Bearer realm=\"security\"",
                        "ApiKey",
                        "Basic realm=\"security\" charset=\"UTF-8\""
                    ]
                }
            }
        ],
        "type": "security_exception",
        "reason": "action [indices:data/read/search] requires authentication",
        "header": {
            "WWW-Authenticate": [
                "Bearer realm=\"security\"",
                "ApiKey",
                "Basic realm=\"security\" charset=\"UTF-8\""
            ]
        }
    },
    "status": 401
}
{
    "error": {
        "root_cause": [
            {
                "type": "illegal_argument_exception",
                "reason": "request [/RIN_Addgene_pr/rin/_search] contains unrecognized parameter: [api_key]"
            }
        ],
        "type": "illegal_argument_exception",
        "reason": "request [/RIN_Addgene_pr/rin/_search] contains unrecognized parameter: [api_key]"
    },
    "status": 400
}
{
    "error": {
        "root_cause": [
            {
                "type": "index_not_found_exception",
                "reason": "no such index",
                "resource.type": "index_or_alias",
                "resource.id": "RIN_Addgene",
                "index_uuid": "_na_",
                "index": "RIN_Addgene"
            }
        ],
        "type": "index_not_found_exception",
        "reason": "no such index",
        "resource.type": "index_or_alias",
        "resource.id": "RIN_Addgene",
        "index_uuid": "_na_",
        "index": "RIN_Addgene"
    },
    "status": 404
}
{
    "error": {
        "root_cause": [
            {
                "type": "json_parse_exception",
                "reason": "Unexpected character ('=' (code 61)): was expecting a colon to separate field name and value\n at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@4eccf1fd; line: 5, column: 25]"
            }
        ],
        "type": "json_parse_exception",
        "reason": "Unexpected character ('=' (code 61)): was expecting a colon to separate field name and value\n at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@4eccf1fd; line: 5, column: 25]"
    },
    "status": 500
}

Elasticsearch Pass-Through

GET https://api.scicrunch.io/elastic/v1/{index}/_search

The pass-through is accessible at https://scicrunch.org/api/1/elastic. Similar to standard Elasticsearch APIs you must then supply an index and an action. In this case the index, the type and the URL search query paramter.

Path Parameters

Name
Type
Description

index*

String

Production RIN index

Query Parameters

Name
Type
Description

q

String

Search String

Headers

Name
Type
Description

apikey*

String

Your API key to access the services

RIN Index Aliases

Index Alias
Description

RIN_Tool_pr

Production tools index

RIN_Antibody_pr

Production antibodies index

RIN_CellLine_pr

Production cell lines index

RIN_Organism_pr

Production organisms index

RIN_Addgene_pr,RIN_DGRC_*_pr

Production plasmids (AddGene & DGRC) indices

RIN_BioSample_pr

Production biosamples index

RIN_Protocols_pr

Production protocols index

*_pr

Production all indices

Using aliases will allow for testing on updates and enhancements to the index structure. If needed additional aliases can be constructed for specialized testing.

Documentation on the Elasticsearch Search API is available at

Management of indices is accomplished via . The index aliases are provided:

https://www.elastic.co/guide/en/elasticsearch/reference/6.8/search.html
https://www.elastic.co/guide/en/elasticsearch/reference/6.8/search.html
Elasticsearch aliases