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

# /api/v1/search

Run searches over the indexed objects, or over a different domain selected by the request `type` (`pool`, `collection`, `event`, `message`, `user`, `group` or `acl`). `POST /search` takes a `SearchRequest` body; `GET /search` takes the same request as a JSON string in the `BODY` query parameter so the call can be cached. Both return a `SearchResponse` with the total `count` and the requested page of `objects`, restricted to what the requesting user may read.

Differs from easydb 5: the searchable domains are `pool`, `collection`, `event`, `message`, `user`, `group` and `acl` (plus the default object search). easydb 5 has no `event` domain, and **fylr** has no `pool_management` domain (easydb 5 documents `pool_management` to search pools with `bag_write`).

From version 6.34.0, every element of the `search` array accepts a `boost` parameter (number, default `1`), with the semantics known from easydb 5: a higher boost gives objects matching that element a higher `_score`. Combine `bool: should` elements with different boosts and sort by `_score` to rank preferred matches first.

From version 6.35.0, a `term` aggregation takes an `aggregations` object like the request itself. Those aggregations run below every bucket and nest to any depth, and every bucket of the response carries their result in the same shape, with `terms`, `limit` and `has_more` per level. Only `term` aggregations nest. Example, the pools of the records per objecttype, ancestor pools included:

```json
"aggregations": {
  "ot": {
    "type": "term",
    "field": "_objecttype",
    "aggregations": {
      "pools": { "type": "term", "field": "_pool._path.pool._id", "limit": 100 }
    }
  }
}
```

### `GET /search` — Search for objects (cacheable).

{% openapi src="/files/kfiDjhyZfEICNBmt5f49" path="/search" method="get" %}
[fylr-openapi.yml](https://4100607288-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAdRFzQASDY2Elfdm3wXW%2Fuploads%2Fgit-blob-c66962d021f9281075604517b7590deaf0d3f984%2Ffylr-openapi.yml?alt=media)
{% endopenapi %}

### `POST /search` — Search for objects.

{% openapi src="/files/kfiDjhyZfEICNBmt5f49" path="/search" method="post" %}
[fylr-openapi.yml](https://4100607288-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAdRFzQASDY2Elfdm3wXW%2Fuploads%2Fgit-blob-c66962d021f9281075604517b7590deaf0d3f984%2Ffylr-openapi.yml?alt=media)
{% endopenapi %}

### `GET /search/parse` — Parse a query string into a search request.

{% openapi src="/files/kfiDjhyZfEICNBmt5f49" path="/search/parse" method="get" %}
[fylr-openapi.yml](https://4100607288-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAdRFzQASDY2Elfdm3wXW%2Fuploads%2Fgit-blob-c66962d021f9281075604517b7590deaf0d3f984%2Ffylr-openapi.yml?alt=media)
{% endopenapi %}

### `POST /search/parse` — Parse a query string into a search request.

{% openapi src="/files/kfiDjhyZfEICNBmt5f49" path="/search/parse" method="post" %}
[fylr-openapi.yml](https://4100607288-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAdRFzQASDY2Elfdm3wXW%2Fuploads%2Fgit-blob-c66962d021f9281075604517b7590deaf0d3f984%2Ffylr-openapi.yml?alt=media)
{% endopenapi %}

### `DELETE /search/point_in_time` — Close point-in-time search contexts.

{% openapi src="/files/kfiDjhyZfEICNBmt5f49" path="/search/point\_in\_time" method="delete" %}
[fylr-openapi.yml](https://4100607288-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAdRFzQASDY2Elfdm3wXW%2Fuploads%2Fgit-blob-c66962d021f9281075604517b7590deaf0d3f984%2Ffylr-openapi.yml?alt=media)
{% endopenapi %}
