# Search Panel

The Grid component has built-in search functionality that you can use through either the SmartBox Search mode or the Search Panel in the toolbar. Both options rely on Grid filtering to show only the relevant records.

## SmartBox Search

The Grid search functionality is available in the [AI Smart Box](https://www.telerik.com/kendo-jquery-ui/documentation/controls/grid/smart-grid/ai-toolbar-tool). The Smart Box Search mode uses the same Grid [`search`](https://www.telerik.com/kendo-jquery-ui/documentation/api/ui/grid/configuration/search) configuration, including [`search.fields`](https://www.telerik.com/kendo-jquery-ui/documentation/api/ui/grid/configuration/search#searchfields) and field operators.

To enable it, add the Smart Box tool to the Grid toolbar and configure the [`smartBox.searchSettings`](https://www.telerik.com/kendo-jquery-ui/documentation/api/ui/grid/configuration/smartbox#smartboxsearchsettings) option.

```javascript
    $("#grid").kendoGrid({
        toolbar: ["smartBox"],
        search: {
            fields: [
                { name: "name", operator: "contains" },
                { name: "age", operator: "eq" }
            ]
        },
        smartBox: {
            activeMode: "Search",
            searchSettings: {
                enabled: true
            }
        }
    });
```

For additional Smart Box search capabilities, such as Semantic Search mode, refer to [Semantic Search](https://www.telerik.com/kendo-jquery-ui/documentation/controls/grid/smart-grid/semantic-search).

## Search Panel

> Search Panel functionality is available as of [`Kendo UI R3 2019`](https://www.telerik.com/support/whats-new/kendo-ui/release-history/kendo-ui-r3-2019) release.

### Getting Started

To enable the functionality include the `search` option to the toolbar configuration.

In addition it is possible to customize which fields to search when a value is entered in the search input.

```js
$("#grid").kendoGrid({
    toolbar: ["search"],
    search: {
        fields: ["ContactTitle"]
    }
});
```

### Specify the filter operator

As of Kendo UI 2021 R3 SP1, you can specify filter operators for each filter type. With this update, you can filter non-string types.

The following example demonstrates how to specify which fields to include in the search

```js
$("#grid").kendoGrid({
    columns: [
        { field: "name" },
        { field: "age" }
    ],
    dataSource: [{ name: "Jane", age: 30 }, { name: "John", age: 33 }],
    toolbar: ["search"],
    search: {
        fields: ["name"] // Or specify multiple fields with operators, e.g., { name: "age", operator: "eq" }
    }
});
```

The following example demonstrates how to specify the operator for the field that will be used in the filter expression.

```js
$("#grid").kendoGrid({
    columns: [
        { field: "name" },
        { field: "age" }
    ],
    dataSource: [{ name: "Jane", age: 30 }, { name: "John", age: 33 }],
    toolbar: ["search"],
    search: {
        fields: ["name", { name: "age", operator: "eq" }]
    }
});
```

### Known Limitations

* When filtering is enabled in the filter textboxes for all Grid columns will be populated with the value entered in the search textbox.

## See Also

* [Search Panel in the KendoUI Grid (Demo)](https://demos.telerik.com/kendo-ui/grid/search-panel)
* [JavaScript API Reference of the KendoUI Grid](https://www.telerik.com/kendo-jquery-ui/documentation/api/ui/grid)
* [Grid Search API](https://www.telerik.com/kendo-jquery-ui/documentation/api/ui/grid/configuration/search)
* [Grid SmartBox API](https://www.telerik.com/kendo-jquery-ui/documentation/api/ui/grid/configuration/smartbox)
* [AI Smart Box](https://www.telerik.com/kendo-jquery-ui/documentation/controls/grid/smart-grid/ai-toolbar-tool)
* [Smart Grid Overview](https://www.telerik.com/kendo-jquery-ui/documentation/controls/grid/smart-grid)
