-
Notifications
You must be signed in to change notification settings - Fork 82
Documented CustomField criterion #2764
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| <?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); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| --- | ||
|
Check warning on line 1 in docs/search/criteria_reference/customfield_criterion.md
|
||
| description: Custom Field Search Criterion | ||
| --- | ||
|
|
||
| # Custom Field Criterion | ||
|
|
||
| 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. | ||
|
Check failure on line 7 in docs/search/criteria_reference/customfield_criterion.md
|
||
|
|
||
| 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](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-Values-Content-Query-Criterion-Operator.html) constants | ||
|
Check failure on line 14 in docs/search/criteria_reference/customfield_criterion.md
|
||
| - `value` - the value to query for | ||
|
|
||
| ## Limitations | ||
|
Check warning on line 17 in docs/search/criteria_reference/customfield_criterion.md
|
||
|
|
||
| The `CustomField` Criterion isn't available in [Repository filtering](search_api.md#repository-filtering). | ||
|
|
||
| ## Example | ||
|
|
||
| ### PHP | ||
|
|
||
| ``` php | ||
| [[= include_file('code_samples/search/content/customfield_criterion.php') =]] | ||
| ``` | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume you got this information from Konrad, as it does not derive directly from the description in API reference?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.