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

# hasFilter

[localhost link]: http://localhost:3000/docs/5/app-studio/reference/filters/lightning.filter.hasFilter

[mintlify link]: https://doc.lucidworks.com/docs/5/app-studio/reference/filters/lightning.filter.hasFilter

[old doc.lw link]: https://doc.lucidworks.com/app-studio/4.2/1024.md

> [card] Key questions to get you started
>
> Powered by Lucidworks Agent Studio

## Description

Returns the first filter object from the query or facet that matches the name and optionally the value also

## Usage

### In HTML Template Binding

```html theme={"dark"}
{{ hasFilter_expression | hasFilter:field[:value] }}
```

### In JavaScript

```js wrap  theme={"dark"}
$filter('hasFilter')(query, field[, value])
```

#### Parameters

| Param | Type | Details |
| - | - | - |
| query | string | The query object |
| field | number | The name of the filter |
| value *(optional)* | number | The value of the filter |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.