> For the complete documentation index, see [llms.txt](https://pm415.gitbook.io/project/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pm415.gitbook.io/project/api-reference/search.md).

# /search

## Get information on a request

<mark style="color:blue;">`GET`</mark> `https://pm415.com/api/search/:query/:orgid/:showarchived`

Gets the information on a text string request.

#### Path Parameters

| Name          | Type    | Description              |
| ------------- | ------- | ------------------------ |
| :showarchived | boolean | True or false            |
| :orgid        | number  | The ID of the org        |
| :query        | string  | Your text string request |

#### Headers

| Name           | Type   | Description                                 |
| -------------- | ------ | ------------------------------------------- |
| Authentication | string | Authorization: Bearer 50ca9ba0f7b1444fa55d5 |

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

```
{
    "success": true,
    "data": [
        {
            "title": "Api created",
            "description": "api created Description",
            "type": "initiatives",
            "author": {
                "id": 13,
                "email": "hwyxlisjb@emlpro.com",
                "firstName": "alena",
                "lastName": "prilipko"
            },
            "assignee": {},
            "organization": 17,
            "id": 25,
            "createdOn": "2019-04-27T07:05:58.621Z",
            "ownerId": "",
            "archived": 0
        }
    ],
    "query": {
        "query": {
            "bool": {
                "must": [
                    {
                        "multi_match": {
                            "query": "api",
                            "fields": [
                                "title",
                                "description",
                                "comment",
                                "author.firstName",
                                "author.lastName",
                                "author.email",
                                "assignee.firstName",
                                "assignee.lastName",
                                "assignee.email",
                                "ownerTable"
                            ],
                            "type": "phrase_prefix"
                        }
                    },
                    {
                        "match": {
                            "organization": "17"
                        }
                    }
                ]
            }
        }
    }
}
```

{% endtab %}
{% endtabs %}

## Add all data

<mark style="color:blue;">`GET`</mark> `https://pm415.com/api/search/reindex`

Adds all data from database into elastic index.

#### Headers

| Name           | Type   | Description                                 |
| -------------- | ------ | ------------------------------------------- |
| Authentication | string | Authorization: Bearer 50ca9ba0f7b1444fa55d5 |

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

```
{
    "success": true,
    "indexInitiatives": true,
    "indexItems": true,
    "indexBacklogs": true,
    "indexBugs": true,
    "indexComments": true
}
```

{% endtab %}
{% endtabs %}
