> For the complete documentation index, see [llms.txt](https://docs.scicrunch.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.scicrunch.io/terminology-services/interlex/untitled.md).

# Searching InterLex

## Introduction

The InterLex APIs are provided via an ElasticSearch endpoint.  &#x20;

### Access to the InterLex APIs

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

## Elasticsearch Pass-Through

<mark style="color:green;">`POST`</mark> `https://api.scicrunch.io/elastic/v1/Interlex_pr/_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 Interlex index (Interlex\_pr) and the search command (\_search).\
\
Documentation on the Elasticsearch Search API is available at <https://www.elastic.co/guide/en/elasticsearch/reference/6.8/search.html&#x20>;

#### Path Parameters

| Name                                    | Type   | Description                       |
| --------------------------------------- | ------ | --------------------------------- |
| index<mark style="color:red;">\*</mark> | string | For InterLex this is Interlex\_pr |

#### Headers

| Name                                     | Type   | Description                         |
| ---------------------------------------- | ------ | ----------------------------------- |
| apikey<mark style="color:red;">\*</mark> | String | Your API key to access the services |

#### Request Body

| Name | Type   | Description     |
| ---- | ------ | --------------- |
| data | String | JSON query body |

{% tabs %}
{% tab title="200 " %}

```
{
    "took": 35,
    "timed_out": false,
    "_shards": {
        "total": 2,
        "successful": 2,
        "skipped": 0,
        "failed": 0
    },
    "hits": {...
```

{% endtab %}
{% endtabs %}

## Elasticsearch Pass-Through

<mark style="color:blue;">`GET`</mark> `https://api.scicrunch.io/elastic/v1/Interlex_pr/_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 Interlex index (Interlex\_pr) and the search command (\_search).\
\
Documentation on the Elasticsearch Search API is available at <https://www.elastic.co/guide/en/elasticsearch/reference/6.8/search.html&#x20>;

#### Path Parameters

| Name                                    | Type   | Description                       |
| --------------------------------------- | ------ | --------------------------------- |
| index<mark style="color:red;">\*</mark> | String | For InterLex this is Interlex\_pr |

#### Query Parameters

| Name | Type   | Description   |
| ---- | ------ | ------------- |
| q    | String | Search String |

#### Headers

| Name                                     | Type   | Description                         |
| ---------------------------------------- | ------ | ----------------------------------- |
| apikey<mark style="color:red;">\*</mark> | String | Your API key to access the services |

### Interlex indices

Management of indices is accomplished via [Elasticsearch aliases](https://www.elastic.co/guide/en/elasticsearch/reference/6.8/indices-aliases.html). The index aliases are provided:

| Index Alias  | Description               |
| ------------ | ------------------------- |
| Interlex\_pr | Production Interlex index |

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


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.scicrunch.io/terminology-services/interlex/untitled.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
