# Custom Field Criterion

The [`CustomField` Search Criterion](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-Values-Content-Query-Criterion-CustomField.html) searches for content or locations based on the contents of the search index fields.

The allowed syntax and operator support might differ between search engines and the type of queried field.

## Arguments

- `target` - string representing the identifier of the search index field
- `operator` - one of [Operator](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-Values-Content-Query-Criterion-Operator.html) constants
- `value` - the value to query for

## Limitations

The `CustomField` Criterion isn't available in [Repository filtering](https://doc.ibexa.co/en/latest/search/search_api/#repository-filtering).

## Example

### PHP

```
<?php declare(strict_types=1);

use Ibexa\Contracts\Core\Repository\Values\Content\Query;
use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\Operator;

$query = new Query();

// Example Solr query: find content items with "content_name_s" starting with "Ibexa"
$query->query = new Query\Criterion\CustomField('content_name_s', Operator::EQ, '/Ibexa.*/');

/** @var \Ibexa\Contracts\Core\Repository\SearchService $searchService */
$searchService->findContent($query);
```
