Skip to content

Commit 5027f1a

Browse files
committed
Added doc for CustomField criterion
1 parent 52de471 commit 5027f1a

File tree

4 files changed

+41
-0
lines changed

4 files changed

+41
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php declare(strict_types=1);
2+
3+
use Ibexa\Contracts\Core\Repository\Values\Content\Query;
4+
use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\Operator;
5+
6+
$query = new Query();
7+
8+
// Example Solr query: find content items with "content_name_s" starting with "Ibexa"
9+
$query->query = new Query\Criterion\CustomField('content_name_s', Operator::EQ, '/Ibexa.*/');
10+
11+
/** @var \Ibexa\Contracts\Core\Repository\SearchService $searchService */
12+
$searchService->findContent($query);
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
description: Custom Field Search Criterion
3+
---
4+
5+
# Custom Field Criterion
6+
7+
The [`CustomField` Search Criterion](/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.
8+
9+
The allowed syntax and operator support might differ between search engines and the type of queried field.
10+
11+
## Arguments
12+
13+
- `target` - string representing the identifier of the search index field
14+
- `operator` - one of [Operator](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-Values-Content-Query-Criterion-Operator.html) constants
15+
- `value` - the value to query for
16+
17+
## Limitations
18+
19+
The `CustomField` Criterion isn't available in [Repository filtering](search_api.md#repository-filtering).
20+
21+
## Example
22+
23+
### PHP
24+
25+
``` php
26+
[[= include_file('code_samples/search/content/customfield_criterion.php') =]]
27+
```

docs/search/criteria_reference/search_criteria_reference.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Due to this storage limitation, searching content using the Country field type o
3030
| [ContentTypeId](contenttypeid_criterion.md) | ID of the content item's content type | &#10004; | &#10004; | &#10004; | &#10004; |
3131
| [ContentTypeIdentifier](contenttypeidentifier_criterion.md) | Identifier of the content item's content type | &#10004; | &#10004; | &#10004; | |
3232
| [CurrencyCodeCriterion](currencycode_criterion.md) | Currency code | &#10004; | &#10004; | &#10004; | |
33+
| [CustomField](customfield_criterion.md) | Custom field | &#10004; | &#10004; | | |
3334
| [DateMetadata](datemetadata_criterion.md) | The date when content was created or last modified | &#10004; | &#10004; | &#10004; | &#10004; |
3435
| [Depth](depth_criterion.md) | Location depth in the content tree | | &#10004; | &#10004; | |
3536
| [Field](field_criterion.md) | Content of one of content item's fields | &#10004; | &#10004; | | |

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,7 @@ nav:
516516
- ContentTypeId: search/criteria_reference/contenttypeid_criterion.md
517517
- ContentTypeIdentifier: search/criteria_reference/contenttypeidentifier_criterion.md
518518
- CurrencyCode: search/criteria_reference/currencycode_criterion.md
519+
- CustomField: search/criteria_reference/customfield_criterion.md
519520
- CustomerGroupId: search/criteria_reference/customergroupid_criterion.md
520521
- DateMetadata: search/criteria_reference/datemetadata_criterion.md
521522
- Depth: search/criteria_reference/depth_criterion.md

0 commit comments

Comments
 (0)