# Search

> Search across text columns with one input.

Source: https://docs.inertiax.dev/table/guide/search/

Call `searchable()` on the text columns you want the search box to match:

**Laravel**

```php
use InertiaX\Table\Columns\TextColumn;

TextColumn::make('name')->searchable();
TextColumn::make('email')->searchable();
```

The search box appears when at least one column is searchable. Built-in Eloquent and collection search matches rows when any searchable column contains the term, ignoring case. Applied filters also constrain the results.

## Search columns by default

**Laravel**

```php
use App\Models\User;
use InertiaX\Table\Table;

Table::make('users')
    ->data(User::class)
    ->autoColumns()
    ->searchableColumns();
```

Text columns inherit the search default. For Eloquent and collections, columns with a `searchUsing()` callback also inherit it; other types stay non-searchable. Set `searchable(false)` on an individual column to exclude it. See [Column-wide defaults](https://docs.inertiax.dev/table/reference/table/#column-wide-defaults) for precedence and validation.

## Change request timing

Search resets the table to page 1. Requests wait 300 ms after the latest search or filter change. Set the delay on the React component:

**React**

```tsx
<AppTable prop="users" debounceMs={250} />
```

Use `0` for immediate requests. See [Request lifecycle](https://docs.inertiax.dev/table/guide/request-lifecycle/) for cancellation and URL state.

## Search other fields

To search a related record’s field, such as an order’s customer name, make a `relationship()` column searchable; see [Show a related field](https://docs.inertiax.dev/table/guide/columns/#show-a-related-field).

For Eloquent and collections, searchable columns with a type other than `text`, including custom types, need a `searchUsing()` callback. See [Custom query behavior](https://docs.inertiax.dev/table/guide/query-callbacks/) for source declarations and callback examples, and [Table API](https://docs.inertiax.dev/table/reference/table/#search) for search limits.

A custom source handles search itself and requires searchable columns to keep `type('text')`. See [Custom-source search](https://docs.inertiax.dev/table/reference/source/#search).
