> ## Documentation Index
> Fetch the complete documentation index at: https://docs.openbridge.shop/llms.txt
> Use this file to discover all available pages before exploring further.

# .search()

> Search collections by query

```javascript theme={null}
openbridge.collections.list().search(query)
```

Filters collections by a text query.

## Parameters

| Param   | Type     | Required | Description         |
| ------- | -------- | -------- | ------------------- |
| `query` | `string` | Yes      | Search query string |

## Returns

`CollectionListBuilder` (chainable)

## Examples

### Basic search

```javascript theme={null}
const { items } = await openbridge.collections.list().search('sale')
```

### With limit

```javascript theme={null}
const { items } = await openbridge.collections.list().search('summer').limit(5)
```

### With field selection

```javascript theme={null}
const { items } = await openbridge.collections
    .list()
    .search('new')
    .select(['title', 'handle', 'image'])
```

### Combined with pagination

```javascript theme={null}
const page1 = await openbridge.collections.list().search('featured').limit(10)

if (page1.pageInfo.hasNextPage && page1.pageInfo.endCursor) {
    const page2 = await openbridge.collections
        .list()
        .search('featured')
        .limit(10)
        .after(page1.pageInfo.endCursor)
}
```
