From b68aa42b25e0979e3faac163a011b0a687c5d0e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Tue, 8 Sep 2026 08:44:33 +0200 Subject: [PATCH] 14: Strip PHP from the search reference trees Removes the PHP example and its implement-it-in-code prose from 168 pages across the criteria, aggregation, sort clause, URL search, activity log, AI actions, content type and embeddings reference trees, leaving each page's feature description, fields, semantics and REST example intact. Pages with no REST counterpart keep no example; none was invented. Deletes search_api.md, a PHP API page, and folds its conceptual introduction into the search landing page. Rewrites its 13 inbound references: de-linked where the sentence still carries the concept, repointed where a surviving reference page covers it. Restores the FieldValueCriterion::COMPARISON_* constants to code spans after ticket 07 removed their links (residue R4). Removes 177 search/ entries from the invariant baseline. Co-Authored-By: Claude Opus 5 (1M context) --- .../rest_api/rest_api_usage/rest_requests.md | 2 +- .../content_api/browsing_content.md | 4 +- .../content_api/managing_content.md | 2 +- .../content_management_api/section_api.md | 2 +- .../taxonomy/taxonomy_api.md | 2 +- docs/index.md | 1 - .../action_criterion.md | 14 - .../logged_at_criterion.md | 12 - .../object_criterion.md | 18 - .../object_name_criterion.md | 10 - .../user_criterion.md | 10 - .../aggregation_reference.md | 2 +- .../authorterm_aggregation.md | 12 - .../basepricestats_aggregation.md | 14 - .../checkboxterm_aggregation.md | 12 - .../contenttypegroupterm_aggregation.md | 12 - .../contenttypeterm_aggregation.md | 12 - .../countryterm_aggregation.md | 12 - .../custompricestats_aggregation.md | 18 - .../datemetadatarange_aggregation.md | 19 - .../daterange_aggregation.md | 20 - .../datetimerange_aggregation.md | 20 - .../floatrange_aggregation.md | 20 - .../floatstats_aggregation.md | 10 - .../integerrange_aggregation.md | 20 - .../integerstats_aggregation.md | 10 - .../keywordterm_aggregation.md | 12 - .../languageterm_aggregation.md | 12 - .../locationchildrenterm_aggregation.md | 12 - .../objectstateterm_aggregation.md | 12 - .../product_attribute_aggregations.md | 27 - .../productavailabilityterm_aggregation.md | 12 - .../productpricerange_aggregation.md | 16 - .../productstockrange_aggregation.md | 17 - .../producttypeterm_aggregation.md | 12 - .../rawrange_aggregation.md | 14 - .../rawstats_aggregation.md | 10 - .../rawterm_aggregation.md | 12 - .../sectionterm_aggregation.md | 12 - .../selectionterm_aggregation.md | 12 - .../subtreeterm_aggregation.md | 12 - .../taxonomyentryid_aggregation.md | 18 - .../timerange_aggregation.md | 24 - .../usermetadataterm_aggregation.md | 12 - .../visibilityterm_aggregation.md | 12 - .../action_configuration_criteria.md | 11 - .../action_configuration_sort_clauses.md | 11 - .../content_type_criteria.md | 6 - .../content_type_sort_clauses.md | 8 - .../criteria_reference/ancestor_criterion.md | 46 +- .../criteria_reference/baseprice_criterion.md | 17 - .../checkboxattribute_criterion.md | 14 - .../colorattribute_criterion.md | 12 - .../criteria_reference/contentid_criterion.md | 10 - .../contentname_criterion.md | 10 - .../contenttypegroupid_criterion.md | 30 +- .../contenttypeid_criterion.md | 10 - .../contenttypeidentifier_criterion.md | 10 - .../criteria_reference/createdat_criterion.md | 14 - .../createdatrange_criterion.md | 14 - .../currencycode_criterion.md | 12 - .../customergroupid_criterion.md | 12 - .../customfield_criterion.md | 12 - .../customprice_criterion.md | 19 - .../datemetadata_criterion.md | 30 +- .../datetimeattribute_criterion.md | 22 +- .../datetimeattributerange_criterion.md | 10 - .../criteria_reference/depth_criterion.md | 12 - .../criteria_reference/field_criterion.md | 29 +- .../fieldrelation_criterion.md | 16 - .../floatattribute_criterion.md | 15 - .../criteria_reference/fulltext_criterion.md | 43 +- .../criteria_reference/image_criterion.md | 31 -- .../imagedimensions_criterion.md | 21 - .../imagefilesize_criterion.md | 10 - .../imageheight_criterion.md | 12 - .../imagemimetype_criterion.md | 25 - .../imageorientation_criterion.md | 28 - .../imagewidth_criterion.md | 12 - .../integerattribute_criterion.md | 15 - .../isbookmarked_criterion.md | 6 - .../iscontainer_criterion.md | 13 - .../iscurrencyenabled_criterion.md | 12 - .../isfieldempty_criterion.md | 29 +- .../ismainlocation_criterion.md | 13 - .../isproductbased_criterion.md | 12 - .../isuserbased_criterion.md | 10 - .../isuserenabled_criterion.md | 10 - .../criteria_reference/isvirtual_criterion.md | 12 - .../languagecode_criterion.md | 36 +- .../locationid_criterion.md | 10 - .../locationremoteid_criterion.md | 10 - .../logicaland_criterion.md | 15 - .../logicalnot_criterion.md | 12 - .../criteria_reference/logicalor_criterion.md | 15 - .../maplocationdistance_criterion.md | 16 - .../notification_datecreated_criterion.md | 8 - .../notification_status_criterion.md | 8 - .../notification_type_criterion.md | 8 - .../objectstateid_criterion.md | 10 - .../objectstateidentifier_criterion.md | 18 - .../parentlocationid_criterion.md | 45 +- .../price_currency_criterion.md | 16 - .../price_customergroup_criterion.md | 16 - .../price_isbaseprice_criterion.md | 13 - .../price_iscustomprice_criterion.md | 13 - .../price_logicaland_criterion.md | 16 - .../price_logicalor_criterion.md | 19 - .../price_product_criterion.md | 13 - .../criteria_reference/priority_criterion.md | 12 - .../productavailability_criterion.md | 12 - .../productcategory_criterion.md | 12 - .../productcategorysubtree_criterion.md | 8 - .../productcode_criterion.md | 12 - .../productname_criterion.md | 12 - .../productstock_criterion.md | 24 - .../productstockrange_criterion.md | 14 - .../producttype_criterion.md | 12 - ...gemeasurementattributemaximum_criterion.md | 20 - ...gemeasurementattributeminimum_criterion.md | 20 - .../criteria_reference/remoteid_criterion.md | 10 - .../search_criteria_reference.md | 5 +- .../criteria_reference/sectionid_criterion.md | 10 - .../sectionidentifier_criterion.md | 10 - .../selectionattribute_criterion.md | 15 - .../criteria_reference/sibling_criterion.md | 24 - .../simplemeasurementattribute_criterion.md | 20 - .../criteria_reference/subtree_criterion.md | 10 - .../symbolattribute_criterion.md | 8 - .../criteria_reference/taxonomy_entry_id.md | 22 - .../criteria_reference/taxonomy_no_entries.md | 17 +- .../criteria_reference/taxonomy_subtree.md | 15 - .../updated_at_criterion.md | 6 - .../updated_at_range_criterion.md | 6 - .../criteria_reference/useremail_criterion.md | 18 - .../criteria_reference/userid_criterion.md | 10 - .../criteria_reference/userlogin_criterion.md | 18 - .../usermetadata_criterion.md | 28 +- .../visibility_criterion.md | 10 - .../embeddings_reference.md | 6 +- docs/search/search.md | 12 +- docs/search/search_api.md | 481 ------------------ .../search_criteria_and_sort_clauses.md | 3 +- docs/search/search_in_trash_reference.md | 2 +- .../baseprice_sort_clause.md | 16 - .../contentid_sort_clause.md | 10 - .../contentname_sort_clause.md | 10 - .../contenttranslatedname_sort_clause.md | 14 - .../contenttypename_sort_clause.md | 10 - .../createdat_sort_clause.md | 16 - .../customfield_sort_clause.md | 12 - .../customprice_sort_clause.md | 21 - .../datemodified_sort_clause.md | 10 - .../datepublished_sort_clause.md | 10 - .../datetrashed_sort_clause.md | 10 - .../depth_sort_clause.md | 10 - .../field_sort_clause.md | 14 - .../sort_clause_reference/id_sort_clause.md | 10 - .../ismainlocation_sort_clause.md | 14 - .../maplocationdistance_sort_clause.md | 14 - .../sort_clause_reference/path_sort_clause.md | 10 - .../priority_sort_clause.md | 10 - .../productavailability_sort_clause.md | 14 - .../productcode_sort_clause.md | 14 - .../productname_sort_clause.md | 14 - .../random_sort_clause.md | 11 - .../score_sort_clause.md | 14 - .../sectionidentifier_sort_clause.md | 10 - .../sectionname_sort_clause.md | 10 - .../sort_clause_reference.md | 3 +- .../userlogin_sort_clause.md | 10 - .../visibility_sort_clause.md | 10 - .../id_url_sort_clause.md | 12 - .../logicaland_url_criterion.md | 15 - .../logicalnot_url_criterion.md | 12 - .../logicalor_url_criterion.md | 15 - .../pattern_url_criterion.md | 10 - .../sectionid_url_criterion.md | 10 - .../sectionidentifier_url_criterion.md | 10 - .../url_url_sort_clause.md | 12 - .../validity_url_criterion.md | 10 - mkdocs.yml | 1 - tests/python/invariants-baseline.yaml | 177 ------- 183 files changed, 40 insertions(+), 3102 deletions(-) delete mode 100644 docs/search/search_api.md diff --git a/docs/api/rest_api/rest_api_usage/rest_requests.md b/docs/api/rest_api/rest_api_usage/rest_requests.md index 0fe823b589a..1e55d3cac5e 100644 --- a/docs/api/rest_api/rest_api_usage/rest_requests.md +++ b/docs/api/rest_api/rest_api_usage/rest_requests.md @@ -180,7 +180,7 @@ This script: ### Search (`/views`) -The `/views` route allows you to [search in the repository](search.md). It works similarly to its [PHP API counterpart](search_api.md). +The `/views` route allows you to [search in the repository](search.md). The model allows combining criteria using the logical operators `AND`, `OR` and `NOT`. diff --git a/docs/content_management/content_api/browsing_content.md b/docs/content_management/content_api/browsing_content.md index 0d89a74fc4d..912dbba318f 100644 --- a/docs/content_management/content_api/browsing_content.md +++ b/docs/content_management/content_api/browsing_content.md @@ -103,7 +103,7 @@ To list Relations to and from your content, you can: - use the `RelationListIteratorAdapter` within a `BatchIterator` which allow traversing the whole relation list -See [Processing large result sets](search_api.md#process-large-result-sets) for more information about the `BatchIterator`. + You can get the current version's `VersionInfo` using `ContentService::loadVersionInfo`. @@ -218,7 +218,7 @@ To go through all the content items contained in a subtree, you need to use the !!! note - Refer to [Searching](search_api.md) for information on more complex search queries. + Refer to [Search](../../search/search.md) for information on more complex search queries. ## Getting parent location diff --git a/docs/content_management/content_api/managing_content.md b/docs/content_management/content_api/managing_content.md index 2956dab4682..91b5c4b1b43 100644 --- a/docs/content_management/content_api/managing_content.md +++ b/docs/content_management/content_api/managing_content.md @@ -128,7 +128,7 @@ $trashService->recover($trashItem, $newParent); ``` You can also search through Trash items and sort the results using several public PHP API Search Criteria and Sort Clauses that have been exposed for `TrashService` queries. -For more information, see [Search in trash](search_api.md#search-in-trash). +For more information, see [Search in trash](../../search/search_in_trash_reference.md). ## Content types diff --git a/docs/content_management/content_management_api/section_api.md b/docs/content_management/content_management_api/section_api.md index fc88c8198ee..bbbf96ec2b6 100644 --- a/docs/content_management/content_management_api/section_api.md +++ b/docs/content_management/content_management_api/section_api.md @@ -30,7 +30,7 @@ You can use `SectionService` to retrieve section information such as whether it' ## Listing content in a section -To list content items assigned to a section you need to make a [query](search_api.md) for content belonging to this section, by applying the `SearchService`. +To list content items assigned to a section you need to make a query for content belonging to this section. You can also use the query to get the total number of assigned content items: ``` php diff --git a/docs/content_management/taxonomy/taxonomy_api.md b/docs/content_management/taxonomy/taxonomy_api.md index 22166003d1b..310aeb053e7 100644 --- a/docs/content_management/taxonomy/taxonomy_api.md +++ b/docs/content_management/taxonomy/taxonomy_api.md @@ -73,7 +73,7 @@ and a `position` parameter, which is either `TaxonomyServiceInterface::MOVE_POSI ## Search -You can search for content based on its taxonomy entry assignments by using the standard [`SearchService`](search_api.md) with taxonomy-specific Search Criteria: +You can search for content based on its taxonomy entry assignments by using taxonomy-specific Search Criteria: | Criterion | Description | |---|---| diff --git a/docs/index.md b/docs/index.md index ab4d1217e9f..9a975285006 100644 --- a/docs/index.md +++ b/docs/index.md @@ -109,7 +109,6 @@
diff --git a/docs/search/activity_log_search_reference/action_criterion.md b/docs/search/activity_log_search_reference/action_criterion.md index 71b9c14cd53..1b58d6d4a91 100644 --- a/docs/search/activity_log_search_reference/action_criterion.md +++ b/docs/search/activity_log_search_reference/action_criterion.md @@ -7,17 +7,3 @@ matches activity log group that has a log entry with one of the given actions. - `actions` - list of action name strings. A set of built-in names is available as `ActivityLogServiceInterface`'s `ACTION_` prefixed constants. - -## Example - -``` php -use Ibexa\Contracts\ActivityLog\ActivityLogServiceInterface; -use Ibexa\Contracts\ActivityLog\Values\ActivityLog as ActivityLog; - -$query = new ActivityLog\Query([ - new ActivityLog\Criterion\ActionCriterion([ - ActivityLogServiceInterface::ACTION_DELETE, - ActivityLogServiceInterface::ACTION_TRASH, - ]), -]); -``` diff --git a/docs/search/activity_log_search_reference/logged_at_criterion.md b/docs/search/activity_log_search_reference/logged_at_criterion.md index c39b486fa3f..538e7b869a3 100644 --- a/docs/search/activity_log_search_reference/logged_at_criterion.md +++ b/docs/search/activity_log_search_reference/logged_at_criterion.md @@ -15,15 +15,3 @@ The `LoggedAtCriterion` Activity Log Criterion matches activity log group that h | Less than or equal | `<=` | `LoggedAtCriterion::LTE` | | Greater than | `>` | `LoggedAtCriterion::GT` | | Greater than or equal | `>=` | `LoggedAtCriterion::GTE` | - -## Example - -The following example is to match all activity log groups that aren't older than a day: - -``` php -use Ibexa\Contracts\ActivityLog\Values\ActivityLog as ActivityLog; - -$query = new ActivityLog\Query([ - new ActivityLog\Criterion\LoggedAtCriterion(new \DateTime('- 1 day'), ActivityLog\Criterion\LoggedAtCriterion::GTE), -]); -``` diff --git a/docs/search/activity_log_search_reference/object_criterion.md b/docs/search/activity_log_search_reference/object_criterion.md index 55e7b069319..f058f6dbd53 100644 --- a/docs/search/activity_log_search_reference/object_criterion.md +++ b/docs/search/activity_log_search_reference/object_criterion.md @@ -6,21 +6,3 @@ The `ObjectCriterion` Activity Log Criterion matches log group with a log entry - `objectClass` - a class of the object concerned by the searched log entries - `ids` - an optional list of object IDs - -## Examples - -``` php -use Ibexa\Contracts\ActivityLog\Values\ActivityLog as ActivityLog; - -$query = new ActivityLog\Query([ - new ActivityLog\Criterion\ObjectCriterion(Ibexa\Contracts\Core\Repository\Values\Content\Content::class), -]); -``` - -``` php -use Ibexa\Contracts\ActivityLog\Values\ActivityLog as ActivityLog; - -$query = new ActivityLog\Query([ - new ActivityLog\Criterion\ObjectCriterion(Ibexa\Contracts\ProductCatalog\Values\ProductVariantInterface::class, ['123', '234', '345']), -]); -``` diff --git a/docs/search/activity_log_search_reference/object_name_criterion.md b/docs/search/activity_log_search_reference/object_name_criterion.md index 1eea5139c36..fc9cc7d6f75 100644 --- a/docs/search/activity_log_search_reference/object_name_criterion.md +++ b/docs/search/activity_log_search_reference/object_name_criterion.md @@ -10,13 +10,3 @@ The `ObjectNameCriterion` Activity Log Criterion matches log groups that have a - `ObjectNameCriterion::OPERATOR_STARTS_WITH` - `ObjectNameCriterion::OPERATOR_ENDS_WITH` - `ObjectNameCriterion::OPERATOR_EQUALS` - -## Example - -``` php -use Ibexa\Contracts\ActivityLog\Values\ActivityLog as ActivityLog; - -$query = new ActivityLog\Query([ - new ActivityLog\Criterion\ObjectNameCriterion('Ibexa', ActivityLog\Criterion\ObjectNameCriterion::OPERATOR_CONTAINS), -]); -``` diff --git a/docs/search/activity_log_search_reference/user_criterion.md b/docs/search/activity_log_search_reference/user_criterion.md index 871f6e61135..075dc781841 100644 --- a/docs/search/activity_log_search_reference/user_criterion.md +++ b/docs/search/activity_log_search_reference/user_criterion.md @@ -5,13 +5,3 @@ The `UserCriterion` Activity Log Criterion matches log groups that have an activ ## Argument - `ids` - list of user IDs - -## Example - -``` php -use Ibexa\Contracts\ActivityLog\Values\ActivityLog as ActivityLog; - -$query = new ActivityLog\Query([ - new ActivityLog\Criterion\UserCriterion([10, 14]), -]); -``` diff --git a/docs/search/aggregation_reference/aggregation_reference.md b/docs/search/aggregation_reference/aggregation_reference.md index 7ae970f8e7e..0cf903eb8af 100644 --- a/docs/search/aggregation_reference/aggregation_reference.md +++ b/docs/search/aggregation_reference/aggregation_reference.md @@ -5,7 +5,7 @@ page_type: reference # Aggregation reference -[Aggregation](search_api.md#aggregation) is used to group search results into categories. +Aggregation is used to group search results into categories. There are three types of aggregations: diff --git a/docs/search/aggregation_reference/authorterm_aggregation.md b/docs/search/aggregation_reference/authorterm_aggregation.md index 5df673979fa..8a0c4facec3 100644 --- a/docs/search/aggregation_reference/authorterm_aggregation.md +++ b/docs/search/aggregation_reference/authorterm_aggregation.md @@ -9,15 +9,3 @@ The field-based AuthorTermAggregation aggregates search results by the value of ## Arguments [[= include_file('docs/snippets/aggregation_arguments.md') =]] - -## Example - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation; - -$query = new Query(); -$query->aggregations[] = new Aggregation\Field\AuthorTermAggregation('author', 'article', 'authors'); -``` - -[[= include_file('docs/snippets/search_term_aggregation_settings.md') =]] diff --git a/docs/search/aggregation_reference/basepricestats_aggregation.md b/docs/search/aggregation_reference/basepricestats_aggregation.md index 492aad61f06..8a8602cc0b6 100644 --- a/docs/search/aggregation_reference/basepricestats_aggregation.md +++ b/docs/search/aggregation_reference/basepricestats_aggregation.md @@ -17,17 +17,3 @@ You can use the provided getters to access the values: - `name` - name of the Aggregation - `\Ibexa\Contracts\ProductCatalog\Values\CurrencyInterface` - currency of the price - -## Example - -``` php -use Ibexa\Contracts\ProductCatalog\Values\CurrencyInterface; -use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; -use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Aggregation\BasePriceStatsAggregation; - -/** @var CurrencyInterface $currency */ -$query = new ProductQuery(); -$query->setAggregations([ - new BasePriceStatsAggregation('base_price_stats_aggregation', $currency), -]); -``` diff --git a/docs/search/aggregation_reference/checkboxterm_aggregation.md b/docs/search/aggregation_reference/checkboxterm_aggregation.md index e9c32683a9d..3e2693fff3a 100644 --- a/docs/search/aggregation_reference/checkboxterm_aggregation.md +++ b/docs/search/aggregation_reference/checkboxterm_aggregation.md @@ -9,15 +9,3 @@ The field-based CheckboxTermAggregation aggregates search results by the value o ## Arguments [[= include_file('docs/snippets/aggregation_arguments.md') =]] - -## Example - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation; - -$query = new Query(); -$query->aggregations[] = new Aggregation\Field\CheckboxTermAggregation('checkbox', 'article', 'enable_comments'); -``` - -[[= include_file('docs/snippets/search_term_aggregation_settings.md') =]] diff --git a/docs/search/aggregation_reference/contenttypegroupterm_aggregation.md b/docs/search/aggregation_reference/contenttypegroupterm_aggregation.md index d17419b162e..242c39bd7c0 100644 --- a/docs/search/aggregation_reference/contenttypegroupterm_aggregation.md +++ b/docs/search/aggregation_reference/contenttypegroupterm_aggregation.md @@ -9,15 +9,3 @@ The ContentTypeGroupTermAggregation aggregates search results by the content ite ## Arguments - `name` - name of the Aggregation object - -## Example - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation; - -$query = new Query(); -$query->aggregations[] = new Aggregation\ContentTypeGroupTermAggregation('content_type_group'); -``` - -[[= include_file('docs/snippets/search_term_aggregation_settings.md') =]] diff --git a/docs/search/aggregation_reference/contenttypeterm_aggregation.md b/docs/search/aggregation_reference/contenttypeterm_aggregation.md index 6fe919b10ac..c7c484cd19e 100644 --- a/docs/search/aggregation_reference/contenttypeterm_aggregation.md +++ b/docs/search/aggregation_reference/contenttypeterm_aggregation.md @@ -9,15 +9,3 @@ The ContentTypeTermAggregation aggregates search results by the content item's c ## Arguments - `name` - name of the Aggregation object - -## Example - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation; - -$query = new Query(); -$query->aggregations[] = new Aggregation\ContentTypeTermAggregation('content_type'); -``` - -[[= include_file('docs/snippets/search_term_aggregation_settings.md') =]] diff --git a/docs/search/aggregation_reference/countryterm_aggregation.md b/docs/search/aggregation_reference/countryterm_aggregation.md index 4eba3da197f..2d341c8374b 100644 --- a/docs/search/aggregation_reference/countryterm_aggregation.md +++ b/docs/search/aggregation_reference/countryterm_aggregation.md @@ -9,15 +9,3 @@ The field-based CountryTermAggregation aggregates search results by the value of ## Arguments [[= include_file('docs/snippets/aggregation_arguments.md') =]] - -## Example - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation; - -$query = new Query(); -$query->aggregations[] = new Aggregation\Field\CountryTermAggregation('country', 'article', 'country'); -``` - -[[= include_file('docs/snippets/search_term_aggregation_settings.md') =]] diff --git a/docs/search/aggregation_reference/custompricestats_aggregation.md b/docs/search/aggregation_reference/custompricestats_aggregation.md index 1433c97352c..5b483fefef3 100644 --- a/docs/search/aggregation_reference/custompricestats_aggregation.md +++ b/docs/search/aggregation_reference/custompricestats_aggregation.md @@ -17,21 +17,3 @@ The CustomPriceStatsAggregation aggregates search results by the value of the cu - `name` - name of the Aggregation - `\Ibexa\Contracts\ProductCatalog\Values\CurrencyInterface` - currency of the price - `\Ibexa\Contracts\ProductCatalog\Values\CustomerGroupInterface|null` - customer group that defines custom pricing, by default it's the one assigned to current user - -## Example - -``` php -use Ibexa\Contracts\ProductCatalog\Values\CurrencyInterface; -use Ibexa\Contracts\ProductCatalog\Values\CustomerGroupInterface; -use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; -use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Aggregation\CustomPriceStatsAggregation; - -/** - * @var CurrencyInterface $currency - * @var CustomerGroupInterface $customerGroup - */ -$query = new ProductQuery(); -$query->setAggregations([ - new CustomPriceStatsAggregation('custom_price_stats_aggregation', $currency, $customerGroup), -]); -``` diff --git a/docs/search/aggregation_reference/datemetadatarange_aggregation.md b/docs/search/aggregation_reference/datemetadatarange_aggregation.md index 899ff17fb46..e905e5b3503 100644 --- a/docs/search/aggregation_reference/datemetadatarange_aggregation.md +++ b/docs/search/aggregation_reference/datemetadatarange_aggregation.md @@ -11,22 +11,3 @@ The DateMetadataRangeAggregation aggregates search results by the value of the c - `name` - name of the Aggregation object - `type` - string representing the type of the Aggregation (`MODIFIED` or `PUBLISHED`) - `ranges` - array of Range objects that define the borders of the specific range sets - -## Example - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation\Range; - -$query = new Query(); -$query->aggregations[] = new Aggregation\DateMetadataRangeAggregation( - 'date_metadata', - Aggregation\DateMetadataRangeAggregation::PUBLISHED, - [ - Range::ofDateTime(null, new DateTime('2020-06-01')), - Range::ofDateTime(new DateTime('2020-06-01'), new DateTime('2020-12-31')), - Range::ofDateTime(new DateTime('2020-12-31'), null), - ] -); -``` diff --git a/docs/search/aggregation_reference/daterange_aggregation.md b/docs/search/aggregation_reference/daterange_aggregation.md index fde8157dddb..0a2c3cf004a 100644 --- a/docs/search/aggregation_reference/daterange_aggregation.md +++ b/docs/search/aggregation_reference/daterange_aggregation.md @@ -11,23 +11,3 @@ The field-based DateRangeAggregation aggregates search results by the value of t [[= include_file('docs/snippets/aggregation_arguments.md') =]] - `ranges` - array of Range objects that define the borders of the specific range sets - -## Example - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation\Range; - -$query = new Query(); -$query->aggregations[] = new Aggregation\Field\DateRangeAggregation( - 'date', - 'event', - 'event_date', - [ - Range::ofDateTime(null, new DateTime('2020-06-01')), - Range::ofDateTime(new DateTime('2020-06-01'), new DateTime('2020-12-31')), - Range::ofDateTime(new DateTime('2020-12-31'), null), -] -); -``` diff --git a/docs/search/aggregation_reference/datetimerange_aggregation.md b/docs/search/aggregation_reference/datetimerange_aggregation.md index 5283ea018ee..53aad2161bb 100644 --- a/docs/search/aggregation_reference/datetimerange_aggregation.md +++ b/docs/search/aggregation_reference/datetimerange_aggregation.md @@ -11,23 +11,3 @@ The field-based DateTimeRangeAggregation aggregates search results by the value [[= include_file('docs/snippets/aggregation_arguments.md') =]] - `ranges` - array of Range objects that define the borders of the specific range sets - -## Example - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation\Range; - -$query = new Query(); -$query->aggregations[] = new Aggregation\Field\DateTimeRangeAggregation( - 'date', - 'event', - 'event_date', - [ - Range::ofDateTime(null, new DateTime('2020-06-01')), - Range::ofDateTime(new DateTime('2020-06-01'), new DateTime('2020-12-31')), - Range::ofDateTime(new DateTime('2020-12-31'), null), -] -); -``` diff --git a/docs/search/aggregation_reference/floatrange_aggregation.md b/docs/search/aggregation_reference/floatrange_aggregation.md index 1c9fd407fb7..817630826de 100644 --- a/docs/search/aggregation_reference/floatrange_aggregation.md +++ b/docs/search/aggregation_reference/floatrange_aggregation.md @@ -11,23 +11,3 @@ The field-based FloatRangeAggregation aggregates search results by the value of [[= include_file('docs/snippets/aggregation_arguments.md') =]] - `ranges` - array of Range objects that define the borders of the specific range sets - -## Example - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation\Range; - -$query = new Query(); -$query->aggregations[] = new Aggregation\Field\FloatRangeAggregation( - 'float', - 'product', - 'weight', - [ - Range::ofFloat(null, 0.25), - Range::ofFloat(0.25, 0.75), - Range::ofFloat(0.75, null), -] -); -``` diff --git a/docs/search/aggregation_reference/floatstats_aggregation.md b/docs/search/aggregation_reference/floatstats_aggregation.md index 2a9df039eb7..a82ba25b753 100644 --- a/docs/search/aggregation_reference/floatstats_aggregation.md +++ b/docs/search/aggregation_reference/floatstats_aggregation.md @@ -16,13 +16,3 @@ You can use the provided getters to access the values: ## Arguments [[= include_file('docs/snippets/aggregation_arguments.md') =]] - -## Example - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation; - -$query = new Query(); -$query->aggregations[] = new Aggregation\Field\FloatStatsAggregation('float', 'product', 'weight'); -``` diff --git a/docs/search/aggregation_reference/integerrange_aggregation.md b/docs/search/aggregation_reference/integerrange_aggregation.md index c518d4511ab..31f96c7da0c 100644 --- a/docs/search/aggregation_reference/integerrange_aggregation.md +++ b/docs/search/aggregation_reference/integerrange_aggregation.md @@ -11,23 +11,3 @@ The field-based IntegerRangeAggregation aggregates search results by the value o [[= include_file('docs/snippets/aggregation_arguments.md') =]] - `ranges` - array of Range objects that define the borders of the specific range sets - -## Example - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation\Range; - -$query = new Query(); -$query->aggregations[] = new Aggregation\Field\IntegerRangeAggregation( - 'integer', - 'product', - 'amount', - [ - Range::ofInt(null, 12), - Range::ofInt(12, 24), - Range::ofInt(24, null), -] -); -``` diff --git a/docs/search/aggregation_reference/integerstats_aggregation.md b/docs/search/aggregation_reference/integerstats_aggregation.md index 83d0303417c..72acad2c38e 100644 --- a/docs/search/aggregation_reference/integerstats_aggregation.md +++ b/docs/search/aggregation_reference/integerstats_aggregation.md @@ -15,13 +15,3 @@ The field-based IntegerStatsAggregation aggregates search results by the value o ## Arguments [[= include_file('docs/snippets/aggregation_arguments.md') =]] - -## Example - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation; - -$query = new Query(); -$query->aggregations[] = new Aggregation\Field\IntegerStatsAggregation('integer', 'product', 'amount'); -``` diff --git a/docs/search/aggregation_reference/keywordterm_aggregation.md b/docs/search/aggregation_reference/keywordterm_aggregation.md index 36f4d27e1ee..45fa456762e 100644 --- a/docs/search/aggregation_reference/keywordterm_aggregation.md +++ b/docs/search/aggregation_reference/keywordterm_aggregation.md @@ -9,15 +9,3 @@ The field-based KeywordTermAggregation aggregates search results by the value of ## Arguments [[= include_file('docs/snippets/aggregation_arguments.md') =]] - -## Example - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation; - -$query = new Query(); -$query->aggregations[] = new Aggregation\Field\KeywordTermAggregation('keyword', 'article', 'tags'); -``` - -[[= include_file('docs/snippets/search_term_aggregation_settings.md') =]] diff --git a/docs/search/aggregation_reference/languageterm_aggregation.md b/docs/search/aggregation_reference/languageterm_aggregation.md index 62a983c0400..dbc6cd4c33e 100644 --- a/docs/search/aggregation_reference/languageterm_aggregation.md +++ b/docs/search/aggregation_reference/languageterm_aggregation.md @@ -9,15 +9,3 @@ The LanguageTermAggregation aggregates search results by the content item's lang ## Arguments - `name` - name of the Aggregation object - -## Example - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation; - -$query = new Query(); -$query->aggregations[] = new Aggregation\LanguageTermAggregation('language'); -``` - -[[= include_file('docs/snippets/search_term_aggregation_settings.md') =]] diff --git a/docs/search/aggregation_reference/locationchildrenterm_aggregation.md b/docs/search/aggregation_reference/locationchildrenterm_aggregation.md index 3888ce13880..0f5de4920c3 100644 --- a/docs/search/aggregation_reference/locationchildrenterm_aggregation.md +++ b/docs/search/aggregation_reference/locationchildrenterm_aggregation.md @@ -9,15 +9,3 @@ The LocationChildrenTermAggregation aggregates search results by the number of c ## Arguments - `name` - name of the Aggregation object - -## Example - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation; - -$query = new LocationQuery(); -$query->aggregations[] = new Aggregation\Location\LocationChildrenTermAggregation('location_children'); -``` - -[[= include_file('docs/snippets/search_term_aggregation_settings.md') =]] diff --git a/docs/search/aggregation_reference/objectstateterm_aggregation.md b/docs/search/aggregation_reference/objectstateterm_aggregation.md index 667b3e4db2d..de88b0e0a7a 100644 --- a/docs/search/aggregation_reference/objectstateterm_aggregation.md +++ b/docs/search/aggregation_reference/objectstateterm_aggregation.md @@ -10,15 +10,3 @@ The ObjectStateTermAggregation aggregates search results by the content item's o - `name` - name of the Aggregation object - `objectStateGroupIdentifier` - string representing the identifier of the object state group to aggregate results by - -## Example - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation; - -$query = new Query(); -$query->aggregations[] = new Aggregation\ObjectStateTermAggregation('object_state', 'ibexa_lock'); -``` - -[[= include_file('docs/snippets/search_term_aggregation_settings.md') =]] diff --git a/docs/search/aggregation_reference/product_attribute_aggregations.md b/docs/search/aggregation_reference/product_attribute_aggregations.md index 845092669d9..5e3e8fb3548 100644 --- a/docs/search/aggregation_reference/product_attribute_aggregations.md +++ b/docs/search/aggregation_reference/product_attribute_aggregations.md @@ -24,30 +24,3 @@ Depending on attribute type, the following aggregations are available: Range aggregations (`ProductAttributeFloatRangeAggregation` and `ProductAttributeIntegerRangeAggregation`) additionally take: - `ranges` - array of Range objects that define the borders of the specific range sets - -## Example - -``` php -use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; -use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Aggregation\AttributeSelectionTermAggregation; - -$query = new ProductQuery(); -$query->setAggregations([ - new AttributeSelectionTermAggregation('skin', 'skin_type'), -]); -``` - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation\Range; -use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; -use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Aggregation\AttributeIntegerRangeAggregation; - -$query = new ProductQuery(); -$query->setAggregations([ - new AttributeIntegerRangeAggregation('buttons', 'number_of_buttons', [ - Range::ofInt(null, 5), - Range::ofInt(5, 10), - Range::ofInt(10, null), - ]), -]); -``` diff --git a/docs/search/aggregation_reference/productavailabilityterm_aggregation.md b/docs/search/aggregation_reference/productavailabilityterm_aggregation.md index 946fb1d611a..3be98e5a0be 100644 --- a/docs/search/aggregation_reference/productavailabilityterm_aggregation.md +++ b/docs/search/aggregation_reference/productavailabilityterm_aggregation.md @@ -9,15 +9,3 @@ The ProductAvailabilityTermAggregation aggregates search results by product avai ## Arguments - `name` - name of the Aggregation object - -## Example - -``` php -use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; -use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Aggregation\ProductAvailabilityTermAggregation; - -$query = new ProductQuery(); -$query->setAggregations([ - new ProductAvailabilityTermAggregation('product_availability'), -]); -``` diff --git a/docs/search/aggregation_reference/productpricerange_aggregation.md b/docs/search/aggregation_reference/productpricerange_aggregation.md index ea1455dbc9c..32da874c58e 100644 --- a/docs/search/aggregation_reference/productpricerange_aggregation.md +++ b/docs/search/aggregation_reference/productpricerange_aggregation.md @@ -11,19 +11,3 @@ The ProductPriceRangeAggregation aggregates search results by the value of the p - `name` - name of the Aggregation - `currencyCode` - currency code of the price - `ranges` - array of Range objects that define the borders of the specific range sets - -## Example - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation\Range; -use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; -use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Aggregation\ProductPriceRangeAggregation; - -$query = new ProductQuery(); -$query->setAggregations([ - new ProductPriceRangeAggregation('price', 'PLN', [ - Range::ofInt(0, 10000), - Range::ofInt(10000, null), - ]), -]); -``` diff --git a/docs/search/aggregation_reference/productstockrange_aggregation.md b/docs/search/aggregation_reference/productstockrange_aggregation.md index d098fe6bcaf..7ce1efb5800 100644 --- a/docs/search/aggregation_reference/productstockrange_aggregation.md +++ b/docs/search/aggregation_reference/productstockrange_aggregation.md @@ -10,20 +10,3 @@ The ProductStockRangeAggregation aggregates search results by products' numerica - `name` - name of the Aggregation - `ranges` - array of Range objects that define the borders of the specific range sets - -## Example - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation\Range; -use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; -use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Aggregation\ProductStockRangeAggregation; - -$productQuery = new ProductQuery(); -$productQuery->setAggregations([ - new ProductStockRangeAggregation('stock', [ - Range::ofInt(null, 10), - Range::ofInt(10, 100), - Range::ofInt(100, null), - ]), -]); -``` diff --git a/docs/search/aggregation_reference/producttypeterm_aggregation.md b/docs/search/aggregation_reference/producttypeterm_aggregation.md index d5f5c10c26f..8e130b9bc3e 100644 --- a/docs/search/aggregation_reference/producttypeterm_aggregation.md +++ b/docs/search/aggregation_reference/producttypeterm_aggregation.md @@ -9,15 +9,3 @@ The ProductTypeTermAggregation aggregates search results by the product type. ## Arguments - `name` - name of the Aggregation object - -## Example - -``` php -use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; -use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Aggregation\ProductTypeTermAggregation; - -$query = new ProductQuery(); -$query->setAggregations([ - new ProductTypeTermAggregation('product_type'), -]); -``` diff --git a/docs/search/aggregation_reference/rawrange_aggregation.md b/docs/search/aggregation_reference/rawrange_aggregation.md index a45489fea5e..8c02e0f557c 100644 --- a/docs/search/aggregation_reference/rawrange_aggregation.md +++ b/docs/search/aggregation_reference/rawrange_aggregation.md @@ -18,17 +18,3 @@ The RawRangeAggregation aggregates search results by the value of the selected s To keep your project search engine independent, don't use the `RawRangeAggregation` Aggregation in production code. Valid use cases are: testing, or temporary (one-off) tools. - -## Example - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation\Range; - -$query = new LocationQuery(); -$query->aggregations[] = new Aggregation\RawRangeAggregation('priority', 'priority_id', [ - Range::ofInt(1, 10), - Range::ofInt(10, 100), -]); -``` diff --git a/docs/search/aggregation_reference/rawstats_aggregation.md b/docs/search/aggregation_reference/rawstats_aggregation.md index bf9f3342a1c..4e38c46d947 100644 --- a/docs/search/aggregation_reference/rawstats_aggregation.md +++ b/docs/search/aggregation_reference/rawstats_aggregation.md @@ -24,13 +24,3 @@ You can use the provided getters to access the values: To keep your project search engine independent, don't use the `RawStatsAggregation` Aggregation in production code. Valid use cases are: testing, or temporary (one-off) tools. - -## Example - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation; - -$query = new Query(); -$query->aggregations[] = new Aggregation\RawStatsAggregation('location_depth', 'depth_i'); -``` diff --git a/docs/search/aggregation_reference/rawterm_aggregation.md b/docs/search/aggregation_reference/rawterm_aggregation.md index f26b6245971..1d29af26f6d 100644 --- a/docs/search/aggregation_reference/rawterm_aggregation.md +++ b/docs/search/aggregation_reference/rawterm_aggregation.md @@ -17,15 +17,3 @@ The RawTermAggregation aggregates search results by the value of the selected se To keep your project search engine independent, don't use the `RawTermAggregation` Aggregation in production code. Valid use cases are: testing, or temporary (one-off) tools. - -## Example - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation; - -$query = new Query(); -$query->aggregations[] = new Aggregation\RawTermAggregation('content_per_content_type', 'content_type_id_id'); -``` - -[[= include_file('docs/snippets/search_term_aggregation_settings.md') =]] diff --git a/docs/search/aggregation_reference/sectionterm_aggregation.md b/docs/search/aggregation_reference/sectionterm_aggregation.md index 20c9af16e3a..3a3a94f0960 100644 --- a/docs/search/aggregation_reference/sectionterm_aggregation.md +++ b/docs/search/aggregation_reference/sectionterm_aggregation.md @@ -9,15 +9,3 @@ The SectionTermAggregation aggregates search results by the content item's secti ## Arguments - `name` - name of the Aggregation object - -## Example - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation; - -$query = new Query(); -$query->aggregations[] = new Aggregation\SectionTermAggregation('section'); -``` - -[[= include_file('docs/snippets/search_term_aggregation_settings.md') =]] diff --git a/docs/search/aggregation_reference/selectionterm_aggregation.md b/docs/search/aggregation_reference/selectionterm_aggregation.md index 57bb2c900af..3e75926ddee 100644 --- a/docs/search/aggregation_reference/selectionterm_aggregation.md +++ b/docs/search/aggregation_reference/selectionterm_aggregation.md @@ -9,15 +9,3 @@ The field-based SelectionTermAggregation aggregates search results by the value ## Arguments [[= include_file('docs/snippets/aggregation_arguments.md') =]] - -## Example - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation; - -$query = new Query(); -$query->aggregations[] = new Aggregation\Field\SelectionTermAggregation('selection', 'article', 'select'); -``` - -[[= include_file('docs/snippets/search_term_aggregation_settings.md') =]] diff --git a/docs/search/aggregation_reference/subtreeterm_aggregation.md b/docs/search/aggregation_reference/subtreeterm_aggregation.md index 73661f91ade..5655014b165 100644 --- a/docs/search/aggregation_reference/subtreeterm_aggregation.md +++ b/docs/search/aggregation_reference/subtreeterm_aggregation.md @@ -10,15 +10,3 @@ The SubtreeTermAggregation aggregates search results by the location's subtree p - `name` - name of the Aggregation object - `pathString` - string representing the pathstring to aggregate results by - -## Example - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation; - -$query = new Query(); -$query->aggregations[] = new Aggregation\Location\SubtreeTermAggregation('pathstring', '/1/2/'); -``` - -[[= include_file('docs/snippets/search_term_aggregation_settings.md') =]] diff --git a/docs/search/aggregation_reference/taxonomyentryid_aggregation.md b/docs/search/aggregation_reference/taxonomyentryid_aggregation.md index ce35d66f949..808bb3b60ec 100644 --- a/docs/search/aggregation_reference/taxonomyentryid_aggregation.md +++ b/docs/search/aggregation_reference/taxonomyentryid_aggregation.md @@ -10,21 +10,3 @@ The `TaxonomyEntryIdAggregation` aggregates search results by the content item's - `name` - name of the Aggregation object - `taxonomyIdentifier` - identifier of the taxonomy to aggregate results by - -## Example - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Taxonomy\Search\Query\Aggregation as Aggregation; - -$query = new Query(); -$query->aggregations[] = new Aggregation\TaxonomyEntryIdAggregation('taxonomy', 'tags'); -``` - -``` php -use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; -use Ibexa\Contracts\Taxonomy\Search\Query\Aggregation\TaxonomyEntryIdAggregation; - -$query = new ProductQuery(); -$query->setAggregations([new TaxonomyEntryIdAggregation('categories', 'product_categories')]); -``` diff --git a/docs/search/aggregation_reference/timerange_aggregation.md b/docs/search/aggregation_reference/timerange_aggregation.md index a7505651a77..d2707863ca8 100644 --- a/docs/search/aggregation_reference/timerange_aggregation.md +++ b/docs/search/aggregation_reference/timerange_aggregation.md @@ -11,27 +11,3 @@ The field-based TimeRangeAggregation aggregates search results by the value of t [[= include_file('docs/snippets/aggregation_arguments.md') =]] - `ranges` - array of Range objects that define the borders of the specific range sets - -## Example - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation\Range; - -$timestamp = mktime(14, 0, 0); -if ($timestamp === false) { - throw new RuntimeException('Failed to create timestamp with mktime.'); -} - -$query = new Query(); -$query->aggregations[] = new Aggregation\Field\TimeRangeAggregation( - 'date', - 'event', - 'event_time', - [ - Range::ofInt(null, $timestamp), - Range::ofInt($timestamp, null), -] -); -``` diff --git a/docs/search/aggregation_reference/usermetadataterm_aggregation.md b/docs/search/aggregation_reference/usermetadataterm_aggregation.md index 063e4f9ba9d..abebd0a3187 100644 --- a/docs/search/aggregation_reference/usermetadataterm_aggregation.md +++ b/docs/search/aggregation_reference/usermetadataterm_aggregation.md @@ -9,15 +9,3 @@ The UserMetadataTermAggregation aggregates search results by the User content it ## Arguments - `name` - name of the Aggregation object - -## Example - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation; - -$query = new Query(); -$query->aggregations[] = new Aggregation\UserMetadataTermAggregation('user_metadata'); -``` - -[[= include_file('docs/snippets/search_term_aggregation_settings.md') =]] diff --git a/docs/search/aggregation_reference/visibilityterm_aggregation.md b/docs/search/aggregation_reference/visibilityterm_aggregation.md index a2a78099d66..1fa03e009a8 100644 --- a/docs/search/aggregation_reference/visibilityterm_aggregation.md +++ b/docs/search/aggregation_reference/visibilityterm_aggregation.md @@ -9,15 +9,3 @@ The VisibilityTermAggregation aggregates search results by the content item's vi ## Arguments - `name` - name of the Aggregation object - -## Example - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation; - -$query = new Query(); -$query->aggregations[] = new Aggregation\VisibilityTermAggregation('visibility'); -``` - -[[= include_file('docs/snippets/search_term_aggregation_settings.md') =]] diff --git a/docs/search/ai_actions_search_reference/action_configuration_criteria.md b/docs/search/ai_actions_search_reference/action_configuration_criteria.md index 3ff0407b951..e51d8fe97be 100644 --- a/docs/search/ai_actions_search_reference/action_configuration_criteria.md +++ b/docs/search/ai_actions_search_reference/action_configuration_criteria.md @@ -15,14 +15,3 @@ Search criteria are found in the `Ibexa\Contracts\ConnectorAi\ActionConfiguratio | LogicalAnd | Composite criterion to group multiple criteria using the AND condition | | LogicalOr | Composite criterion to group multiple criteria using the OR condition | | Type | Find Action Configuration having the exact given type | - -The following example shows how to use them to find specific Action Configurations: - -``` php -[[= include_code('code_samples/ai_actions/src/Query/Search.php') =]] -``` - -The result set contains Action Configurations that are: - -- enabled, and -- with an identifier equal to `casual` or with a name starting with `Casual`. diff --git a/docs/search/ai_actions_search_reference/action_configuration_sort_clauses.md b/docs/search/ai_actions_search_reference/action_configuration_sort_clauses.md index f29cf06e134..5a4db9f9d2c 100644 --- a/docs/search/ai_actions_search_reference/action_configuration_sort_clauses.md +++ b/docs/search/ai_actions_search_reference/action_configuration_sort_clauses.md @@ -10,14 +10,3 @@ Sort Clauses are found in the `Ibexa\Contracts\ConnectorAi\ActionConfiguration\Q - Enabled - Id - Identifier - -The following example shows how to use them to sort the searched Action Configurations: - -``` php -[[= include_code('code_samples/ai_actions/src/Query/Search.php') =]] -``` - -The search results are sorted by: - -- status, with enabled on top -- identifier, in ascending order. diff --git a/docs/search/content_type_search_reference/content_type_criteria.md b/docs/search/content_type_search_reference/content_type_criteria.md index 253fb04d55f..245e2e580c5 100644 --- a/docs/search/content_type_search_reference/content_type_criteria.md +++ b/docs/search/content_type_search_reference/content_type_criteria.md @@ -19,9 +19,3 @@ Content Type Search Criteria are only supported by [Content Type Search (`Conten | LogicalAnd | Implements a logical AND Criterion. It matches if ALL of the provided Criteria match. | | LogicalOr | Implements a logical OR Criterion. It matches if at least one of the provided Criteria matches. | | LogicalNot | Implements a logical NOT Criterion. It matches if the provided Criterion doesn't match. | - -The following example shows how to use them to search for content types: - -``` php hl_lines="29-31" -[[= include_code('code_samples/api/public_php_api/src/Command/FindContentTypeCommand.php') =]] -``` diff --git a/docs/search/content_type_search_reference/content_type_sort_clauses.md b/docs/search/content_type_search_reference/content_type_sort_clauses.md index da21282d7d6..d4835c152eb 100644 --- a/docs/search/content_type_search_reference/content_type_sort_clauses.md +++ b/docs/search/content_type_search_reference/content_type_sort_clauses.md @@ -15,11 +15,3 @@ Sort Clauses are found in the `Ibexa\Contracts\Core\Repository\Values\ContentTyp | Id| Sort by content type's id | | Identifier| Sort by content type's identifier | | Name| Sort by content type's name | - -The following example shows how to use them to sort the searched content types: - -``` php hl_lines="34-36" -[[= include_code('code_samples/api/public_php_api/src/Command/FindContentTypeCommand.php') =]] -``` - -You can change the default sorting order by using the `SORT_ASC` and `SORT_DESC` constants from `AbstractSortClause`. diff --git a/docs/search/criteria_reference/ancestor_criterion.md b/docs/search/criteria_reference/ancestor_criterion.md index bb7fd1ce52c..64667b62bdb 100644 --- a/docs/search/criteria_reference/ancestor_criterion.md +++ b/docs/search/criteria_reference/ancestor_criterion.md @@ -12,17 +12,6 @@ The `Ancestor` Search Criterion searches for content that is an ancestor of the ## Example -### PHP - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; - -$query = new Query(); -/** @var \Ibexa\Contracts\Core\Repository\LocationService $locationService */ -$query->query = new Criterion\Ancestor([$locationService->loadLocation(62)->pathString]); -``` - ### REST API === "XML" @@ -47,37 +36,4 @@ $query->query = new Criterion\Ancestor([$locationService->loadLocation(62)->path ## Use case -You can use the Ancestor Search Criterion to create a list of breadcrumbs leading to the Location: - -``` php hl_lines="8" -use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; - -$locationId = 12345; - -$query = new LocationQuery(); -/** @var \Ibexa\Contracts\Core\Repository\LocationService $locationService */ -$query->query = new Criterion\Ancestor([$locationService->loadLocation($locationId)->pathString]); - -/** @var \Ibexa\Contracts\Core\Repository\SearchService $searchService */ -$results = $searchService->findLocations($query); -$breadcrumbs = []; -foreach ($results->searchHits as $searchHit) { - $breadcrumbs[] = $searchHit; -} - -return $this->render('parts/breadcrumbs.html.twig', [ - 'breadcrumbs' => $breadcrumbs, -]); -``` - -``` html+twig -{% for breadcrumb in breadcrumbs %} - {% if not loop.first %} -> {% endif %} - {% if not loop.last %} - {{ breadcrumb.valueObject.contentInfo.name }} - {% else %} - {{ breadcrumb.valueObject.contentInfo.name }} - {% endif %} -{% endfor %} -``` +You can use the `Ancestor` Search Criterion to create a list of breadcrumbs leading to a location, because it matches every ancestor of that location, including the location itself. diff --git a/docs/search/criteria_reference/baseprice_criterion.md b/docs/search/criteria_reference/baseprice_criterion.md index 1f8efe27a6c..adaf948ab59 100644 --- a/docs/search/criteria_reference/baseprice_criterion.md +++ b/docs/search/criteria_reference/baseprice_criterion.md @@ -14,20 +14,3 @@ The `BasePrice` Search Criterion searches for products by their base price. ## Limitations The `BasePrice` Criterion isn't available in the Legacy Search engine. - -## Example - -### PHP - -``` php -use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; -use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; - -$query = new ProductQuery( - null, - new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\BasePrice( - \Money\Money::EUR(12900), - \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\Operator::GTE - ) -); -``` diff --git a/docs/search/criteria_reference/checkboxattribute_criterion.md b/docs/search/criteria_reference/checkboxattribute_criterion.md index 64fefc9895b..73d7c45b66f 100644 --- a/docs/search/criteria_reference/checkboxattribute_criterion.md +++ b/docs/search/criteria_reference/checkboxattribute_criterion.md @@ -10,17 +10,3 @@ The `CheckboxAttribute` Search Criterion searches for products by the value of t - `identifier` - string representing the attribute - `value` - bool representing the attribute value - -## Example - -### PHP - -``` php -use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; -use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; - -$query = new ProductQuery( - null, - new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\CheckboxAttribute('automatic', true) -); -``` diff --git a/docs/search/criteria_reference/colorattribute_criterion.md b/docs/search/criteria_reference/colorattribute_criterion.md index 2de0571bbb1..5736c6612d3 100644 --- a/docs/search/criteria_reference/colorattribute_criterion.md +++ b/docs/search/criteria_reference/colorattribute_criterion.md @@ -13,18 +13,6 @@ The `ColorAttribute` Search Criterion searches for products by the value of thei ## Example -### PHP - -``` php -use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; -use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; - -$query = new ProductQuery( - null, - new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\ColorAttribute('color', ['#FF0000']) -); -``` - ### REST API === "XML" diff --git a/docs/search/criteria_reference/contentid_criterion.md b/docs/search/criteria_reference/contentid_criterion.md index 43b6385e670..78276729b98 100644 --- a/docs/search/criteria_reference/contentid_criterion.md +++ b/docs/search/criteria_reference/contentid_criterion.md @@ -12,16 +12,6 @@ The `ContentId` Search Criterion searches for content by its ID. ## Example -### PHP - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; - -$query = new Query(); -$query->query = new Criterion\ContentId([62, 64]); -``` - ### REST API === "XML" diff --git a/docs/search/criteria_reference/contentname_criterion.md b/docs/search/criteria_reference/contentname_criterion.md index c91512386c3..e096aea6748 100644 --- a/docs/search/criteria_reference/contentname_criterion.md +++ b/docs/search/criteria_reference/contentname_criterion.md @@ -12,16 +12,6 @@ The [`ContentName` Search Criterion](https://github.com/ibexa/core/blob/6.0/src/ ## Example -### PHP - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; - -$query = new Query(); -$query->query = new Criterion\ContentName('*phone'); -``` - ### REST API === "XML" diff --git a/docs/search/criteria_reference/contenttypegroupid_criterion.md b/docs/search/criteria_reference/contenttypegroupid_criterion.md index 22a6c5acba4..57b84e721b6 100644 --- a/docs/search/criteria_reference/contenttypegroupid_criterion.md +++ b/docs/search/criteria_reference/contenttypegroupid_criterion.md @@ -12,16 +12,6 @@ The `ContentTypeGroupId` Search Criterion searches for content based on the ID o ## Example -### PHP - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; - -$query = new Query(); -$query->query = new Criterion\ContentTypeGroupId([1, 2]); -``` - ### REST API === "XML" @@ -46,21 +36,5 @@ $query->query = new Criterion\ContentTypeGroupId([1, 2]); ## Use case -You can use the `ContentTypeGroupId` Criterion to query all Media content items -(the default ID for the Media content type group is 3): - -``` php hl_lines="6" -use Ibexa\Contracts\Core\Repository\SearchService; -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; - -$query = new Query(); -$query->query = new Criterion\ContentTypeGroupId([3]); - -/** @var SearchService $searchService */ -$results = $searchService->findContent($query); -$media = []; -foreach ($results->searchHits as $searchHit) { - $media[] = $searchHit; -} -``` +You can use the `ContentTypeGroupId` Criterion to query all Media content items. +The default ID for the Media content type group is 3. diff --git a/docs/search/criteria_reference/contenttypeid_criterion.md b/docs/search/criteria_reference/contenttypeid_criterion.md index 3cd951a0a8e..5e138e8b234 100644 --- a/docs/search/criteria_reference/contenttypeid_criterion.md +++ b/docs/search/criteria_reference/contenttypeid_criterion.md @@ -12,16 +12,6 @@ The `ContentTypeId` Search Criterion searches for content based on the ID of its ## Example -### PHP - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; - -$query = new Query(); -$query->query = new Criterion\ContentTypeId([44]); -``` - ### REST API === "XML" diff --git a/docs/search/criteria_reference/contenttypeidentifier_criterion.md b/docs/search/criteria_reference/contenttypeidentifier_criterion.md index 0323e1f5922..14497016ec5 100644 --- a/docs/search/criteria_reference/contenttypeidentifier_criterion.md +++ b/docs/search/criteria_reference/contenttypeidentifier_criterion.md @@ -12,16 +12,6 @@ The `ContentTypeIdentifier` Search Criterion searches for content based on the i ## Example -### PHP - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; - -$query = new Query(); -$query->query = new Criterion\ContentTypeIdentifier(['article', 'blog_post']); -``` - ### REST API === "XML" diff --git a/docs/search/criteria_reference/createdat_criterion.md b/docs/search/criteria_reference/createdat_criterion.md index 1c146535aad..ea244783a64 100644 --- a/docs/search/criteria_reference/createdat_criterion.md +++ b/docs/search/criteria_reference/createdat_criterion.md @@ -13,20 +13,6 @@ The `CreatedAt` Search Criterion searches for products based on the date when th ## Example -### PHP - -``` php -use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; -use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; - -$criteria = new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\CreatedAt( - new DateTime('2023-03-01'), - \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\Operator::GTE, -); - -$productQuery = new ProductQuery(null, $criteria); -``` - ### REST API === "XML" diff --git a/docs/search/criteria_reference/createdatrange_criterion.md b/docs/search/criteria_reference/createdatrange_criterion.md index 04a1265c202..a2befb0dc4b 100644 --- a/docs/search/criteria_reference/createdatrange_criterion.md +++ b/docs/search/criteria_reference/createdatrange_criterion.md @@ -13,20 +13,6 @@ The `CreatedAtRange` Search Criterion searches for products based on the date ra ## Example -### PHP - -``` php -use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; -use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; - -$criteria = new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\CreatedAtRange( - new \DateTimeImmutable('2020-07-10T00:00:00+00:00'), - new \DateTimeImmutable('2023-07-12T00:00:00+00:00') -); - -$productQuery = new ProductQuery(null, $criteria); -``` - ### REST API === "XML" diff --git a/docs/search/criteria_reference/currencycode_criterion.md b/docs/search/criteria_reference/currencycode_criterion.md index 7c6b98cbe51..4b8ab315d35 100644 --- a/docs/search/criteria_reference/currencycode_criterion.md +++ b/docs/search/criteria_reference/currencycode_criterion.md @@ -13,15 +13,3 @@ The `CurrencyCodeCriterion` Search Criterion searches for currencies by their co ## Limitations The `CurrencyCodeCriterion` Criterion isn't available in Solr or Elasticsearch engines. - -## Example - -### PHP - -``` php -use Ibexa\Contracts\ProductCatalog\Values\Currency\CurrencyQuery; - -$query = new CurrencyQuery( - new \Ibexa\Contracts\ProductCatalog\Values\Currency\Query\Criterion\CurrencyCodeCriterion('EUR') -); -``` diff --git a/docs/search/criteria_reference/customergroupid_criterion.md b/docs/search/criteria_reference/customergroupid_criterion.md index 44c7b31977c..8bf2d16795a 100644 --- a/docs/search/criteria_reference/customergroupid_criterion.md +++ b/docs/search/criteria_reference/customergroupid_criterion.md @@ -9,15 +9,3 @@ The `CustomerGroupId` Search Criterion searches for content based on the ID of i ## Arguments - `value` - int(s) representing the customer group ID(s) - -## Example - -### PHP - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\ProductCatalog\Values\Content\Query\Criterion; - -$query = new Query(); -$query->query = new Criterion\CustomerGroupId(1); -``` diff --git a/docs/search/criteria_reference/customfield_criterion.md b/docs/search/criteria_reference/customfield_criterion.md index 6ac20c5116f..633133ba501 100644 --- a/docs/search/criteria_reference/customfield_criterion.md +++ b/docs/search/criteria_reference/customfield_criterion.md @@ -14,15 +14,3 @@ The allowed syntax and operator support might differ between search engines and - `target` - string representing the identifier of the search index field - `operator` - one of Operator constants - `value` - the value to query for - -## Limitations - -The `CustomField` Criterion isn't available in [Repository filtering](search_api.md#repository-filtering). - -## Example - -### PHP - -``` php -[[= include_code('code_samples/search/content/customfield_criterion.php') =]] -``` diff --git a/docs/search/criteria_reference/customprice_criterion.md b/docs/search/criteria_reference/customprice_criterion.md index 0855e9e5960..2f108b09e9b 100644 --- a/docs/search/criteria_reference/customprice_criterion.md +++ b/docs/search/criteria_reference/customprice_criterion.md @@ -16,22 +16,3 @@ If you don't provide a customer group, the query uses the group related to the c ## Limitations The `CustomPrice` Criterion isn't available in the Legacy Search engine. - -## Example - -### PHP - -``` php -use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; -use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; - -/** @var \Ibexa\Contracts\ProductCatalog\Values\CustomerGroupInterface $customerGroup */ -$query = new ProductQuery( - null, - new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\CustomPrice( - \Money\Money::EUR(13800), - \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\Operator::GTE, - $customerGroup - ) -); -``` diff --git a/docs/search/criteria_reference/datemetadata_criterion.md b/docs/search/criteria_reference/datemetadata_criterion.md index 33d2dff2f19..89d58f8d4a9 100644 --- a/docs/search/criteria_reference/datemetadata_criterion.md +++ b/docs/search/criteria_reference/datemetadata_criterion.md @@ -14,20 +14,6 @@ The `DateMetadata` Search Criterion searches for content based on the date when ## Example -### PHP - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; - -$query = new Query(); -$query->query = new Criterion\DateMetadata( - Criterion\DateMetadata::CREATED, - Criterion\Operator::BETWEEN, - [1576800000, 1576972800] -); -``` - ### REST API === "XML" @@ -60,18 +46,4 @@ $query->query = new Criterion\DateMetadata( ## Use case -You can use the `DateMetadata` Criterion to search for blog posts that have been created within the last week: - -``` php hl_lines="9" -use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; - -$query = new LocationQuery(); -$date = strtotime('-1 week'); -$query->query = new Criterion\LogicalAnd( - [ - new Criterion\ContentTypeIdentifier('blog_post'), - new Criterion\DateMetadata(Criterion\DateMetadata::CREATED, Criterion\Operator::GTE, $date), - ] -); -``` +You can use the `DateMetadata` Criterion to search for blog posts that have been created within the last week, by combining it with a content type Criterion and the `GTE` operator. diff --git a/docs/search/criteria_reference/datetimeattribute_criterion.md b/docs/search/criteria_reference/datetimeattribute_criterion.md index 3b2c2238b9a..8bdfe2d1920 100644 --- a/docs/search/criteria_reference/datetimeattribute_criterion.md +++ b/docs/search/criteria_reference/datetimeattribute_criterion.md @@ -15,19 +15,9 @@ The `DateTimeAttribute Search Criterion` searches for products by value of a spe The following operators are supported: -- FieldValueCriterion::COMPARISON_EQ -- FieldValueCriterion::COMPARISON_NEQ -- FieldValueCriterion::COMPARISON_LT -- FieldValueCriterion::COMPARISON_LTE -- FieldValueCriterion::COMPARISON_GT -- FieldValueCriterion::COMPARISON_GTE - -## Example - -### PHP - -The following example lists all products for which the `event_date` attribute has value equal to 2025-07-06. - -``` php -[[= include_code('code_samples/back_office/search/src/Query/DateTimeAttributeQuery.php') =]] -``` +- `FieldValueCriterion::COMPARISON_EQ` +- `FieldValueCriterion::COMPARISON_NEQ` +- `FieldValueCriterion::COMPARISON_LT` +- `FieldValueCriterion::COMPARISON_LTE` +- `FieldValueCriterion::COMPARISON_GT` +- `FieldValueCriterion::COMPARISON_GTE` \ No newline at end of file diff --git a/docs/search/criteria_reference/datetimeattributerange_criterion.md b/docs/search/criteria_reference/datetimeattributerange_criterion.md index be8496a2982..bcf3d697ff1 100644 --- a/docs/search/criteria_reference/datetimeattributerange_criterion.md +++ b/docs/search/criteria_reference/datetimeattributerange_criterion.md @@ -11,13 +11,3 @@ The `DateTimeAttributeRange Search Criterion` searches for products by value of - `identifier` - attribute's identifier (string) - `min` - lower range value (inclusive) of [DateTimeImmutable](https://www.php.net/manual/en/class.datetimeimmutable.php) type. Optional. - `max` - upper range value (inclusive) of [DateTimeImmutable](https://www.php.net/manual/en/class.datetimeimmutable.php) type. Optional. - -## Example - -### PHP - -The following example lists all products for which the `event_date` attribute has value greater than 2025-01-01. - -``` php -[[= include_code('code_samples/back_office/search/src/Query/DateTimeAttributeRangeQuery.php') =]] -``` diff --git a/docs/search/criteria_reference/depth_criterion.md b/docs/search/criteria_reference/depth_criterion.md index 0eeaeb2569f..53159828884 100644 --- a/docs/search/criteria_reference/depth_criterion.md +++ b/docs/search/criteria_reference/depth_criterion.md @@ -18,15 +18,3 @@ The `value` argument requires: - a list of ints for `Operator::IN` - exactly two ints for `Operator::BETWEEN` - a single int for other Operators - -## Example - -### PHP - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; - -$query = new Query(); -$query->query = new Criterion\Location\Depth(Criterion\Operator::LT, 3); -``` diff --git a/docs/search/criteria_reference/field_criterion.md b/docs/search/criteria_reference/field_criterion.md index 882be7cfe10..4ae54cf7ac6 100644 --- a/docs/search/criteria_reference/field_criterion.md +++ b/docs/search/criteria_reference/field_criterion.md @@ -17,22 +17,8 @@ The `LIKE` operator works together with wildcards (`*`). Without a wildcards its The `CONTAINS` operator works with collection fields like the Country field type, enabling you to retrieve results when the query value is one of the values of the collection. Querying for a collection with the `EQ` operator returns result only when the whole collection equals the query values. -## Limitations - -The `Field` Criterion isn't available in [Repository filtering](search_api.md#repository-filtering). - ## Example -### PHP - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; - -$query = new Query(); -$query->query = new Criterion\Field('name', Criterion\Operator::CONTAINS, 'Platform'); -``` - ### REST API === "XML" @@ -67,17 +53,4 @@ $query->query = new Criterion\Field('name', Criterion\Operator::CONTAINS, 'Platf ## Use case -You can use the `Field` Criterion to search for articles that contain the word "featured": - -``` php hl_lines="8" -use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; - -$query = new LocationQuery(); -$query->query = new Criterion\LogicalAnd( - [ - new Criterion\ContentTypeIdentifier('article'), - new Criterion\Field('name', Criterion\Operator::CONTAINS, 'Featured'), - ] -); -``` +You can use the `Field` Criterion to search for articles whose `name` field contains the word "Featured", by combining it with a content type Criterion and the `CONTAINS` operator. diff --git a/docs/search/criteria_reference/fieldrelation_criterion.md b/docs/search/criteria_reference/fieldrelation_criterion.md index 874303a00bb..016e0aa2a26 100644 --- a/docs/search/criteria_reference/fieldrelation_criterion.md +++ b/docs/search/criteria_reference/fieldrelation_criterion.md @@ -13,19 +13,3 @@ The `FieldRelation` Search Criterion searches for content based on the content i - `value` - array of ints representing the Relation content IDs to search for Use of IN means the Relation needs to have one of the provided IDs, while CONTAINS implies it needs to have all provided IDs. - -## Limitations - -The `FieldRelation` Criterion isn't available in [Repository filtering](search_api.md#repository-filtering). - -## Example - -### PHP - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; - -$query = new Query(); -$query->query = new Criterion\FieldRelation('relations', Criterion\Operator::CONTAINS, [55, 63]); -``` diff --git a/docs/search/criteria_reference/floatattribute_criterion.md b/docs/search/criteria_reference/floatattribute_criterion.md index 928f495b7a7..c05daaf96af 100644 --- a/docs/search/criteria_reference/floatattribute_criterion.md +++ b/docs/search/criteria_reference/floatattribute_criterion.md @@ -13,21 +13,6 @@ The `FloatAttribute` Search Criterion searches for products by the value of thei ## Example -### PHP - -``` php -use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; -use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; - -$query = new ProductQuery( - null, - new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\FloatAttribute( - 'length', - 16.5 - ) -); -``` - ### REST API === "XML" diff --git a/docs/search/criteria_reference/fulltext_criterion.md b/docs/search/criteria_reference/fulltext_criterion.md index 422430d5b05..20ec3744bb1 100644 --- a/docs/search/criteria_reference/fulltext_criterion.md +++ b/docs/search/criteria_reference/fulltext_criterion.md @@ -33,40 +33,8 @@ supports asterisks as wildcards located at the beginning or end of a query. When using the Elasticsearch search engine, a full text query performs an OR query by default, while the OR and AND operators return unexpected results. -The `FullText` Criterion isn't available in [Repository filtering](search_api.md#repository-filtering). - ## Example -### PHP - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; - -$query = new Query(); -$query->query = new Criterion\FullText('victory'); -``` - -Using double quotes to indicate a phrase: - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; - -$query = new Query(); -$query->query = new Criterion\FullText('"world cup"'); -``` - -Using the AND operator and parenthesis to search for both words at the same time: - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; - -$query = new Query(); -$query->query = new Criterion\FullText('baseball AND cup'); -``` - ### REST API === "XML" @@ -91,15 +59,8 @@ $query->query = new Criterion\FullText('baseball AND cup'); ## Use cases -Assume the following search query: - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; - -$query = new Query(); -$query->query = new Criterion\FullText('(cup AND ba*ball) "breaking news"'); -``` +Assume a full-text search for `(cup AND ba*ball) "breaking news"`, +which combines grouping, the `AND` operator, a wildcard, and a quoted phrase. It returns content containing phrases such as "Breaking news", "Baseball world cup", "Basketball cup", or "Breaking news: Baseball world cup victory". diff --git a/docs/search/criteria_reference/image_criterion.md b/docs/search/criteria_reference/image_criterion.md index 43ad087a37a..c3879df04b5 100644 --- a/docs/search/criteria_reference/image_criterion.md +++ b/docs/search/criteria_reference/image_criterion.md @@ -13,37 +13,6 @@ The `Image` Search Criterion searches for image by specified image attributes. ## Example -### PHP - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; - -$imageCriteriaData = [ - 'mimeTypes' => [ - 'image/png', - ], - 'orientation' => [ - 'image/png', - ], - 'width' => [ - 'min' => 0, // (default: 0, optional) - 'max' => 1000, // (default: null, optional) - ], - 'height' => [ - 'min' => 0, // (default: 0, optional) - 'max' => 1000, // (default: null, optional) - ], - 'size' => [ - 'min' => 0, // (default: 0, optional) - 'max' => 2, // (default: null, optional) - ], -]; - -$query = new Query(); -$query->query = new Criterion\Image('image', $imageCriteriaData); -``` - ### REST API === "XML" diff --git a/docs/search/criteria_reference/imagedimensions_criterion.md b/docs/search/criteria_reference/imagedimensions_criterion.md index 85bad978be2..fd0ce9669f2 100644 --- a/docs/search/criteria_reference/imagedimensions_criterion.md +++ b/docs/search/criteria_reference/imagedimensions_criterion.md @@ -13,27 +13,6 @@ The `Dimensions` Search Criterion searches for image with specified dimensions. ## Example -### PHP - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; - -$query = new Query(); -$imageCriteriaData = [ - 'width' => [ - 'min' => 100, // (default: 0, optional) - 'max' => 1000, // (default: null, optional) - ], - 'height' => [ - 'min' => 500, // (default: 0, optional) - 'max' => 1500, // (default: null, optional) - ], -]; - -$query->query = new Criterion\Image\Dimensions('image', $imageCriteriaData); -``` - ### REST API === "XML" diff --git a/docs/search/criteria_reference/imagefilesize_criterion.md b/docs/search/criteria_reference/imagefilesize_criterion.md index 284d4507d21..3ae60de7a03 100644 --- a/docs/search/criteria_reference/imagefilesize_criterion.md +++ b/docs/search/criteria_reference/imagefilesize_criterion.md @@ -14,16 +14,6 @@ The `FileSize` Search Criterion searches for image with specified size. ## Example -### PHP - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; - -$query = new Query(); -$query->query = new Criterion\Image\FileSize('image', 0, 1.5); -``` - ### REST API === "XML" diff --git a/docs/search/criteria_reference/imageheight_criterion.md b/docs/search/criteria_reference/imageheight_criterion.md index ff8402b4ae7..0db5aff05a1 100644 --- a/docs/search/criteria_reference/imageheight_criterion.md +++ b/docs/search/criteria_reference/imageheight_criterion.md @@ -11,15 +11,3 @@ The `Height` Search Criterion searches for image with specified height. - `fieldDefIdentifier` - string representing the identifier of the field - (optional) `minValue` - int representing minimum file height expressed in pixels, default: 0 - (optional) `maxValue` - int representing maximum file height expressed in pixels, default: `null` - -## Example - -### PHP - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; - -$query = new Query(); -$query->query = new Criterion\Image\Height('image', 0, 1500); -``` diff --git a/docs/search/criteria_reference/imagemimetype_criterion.md b/docs/search/criteria_reference/imagemimetype_criterion.md index 0564efd8da9..500efb3315d 100644 --- a/docs/search/criteria_reference/imagemimetype_criterion.md +++ b/docs/search/criteria_reference/imagemimetype_criterion.md @@ -13,31 +13,6 @@ The `MimeType` Search Criterion searches for image with specified mime type(s). ## Example -### PHP - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; - -$query = new Query(); -$query->query = new Criterion\Image\MimeType('image', 'image/jpeg'); -``` - -or - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; - -$query = new Query(); -$mimeTypes = [ - 'image/jpeg', - 'image/png', -]; - -$query->query = new Criterion\Image\MimeType('image', $mimeTypes); -``` - ### REST API === "XML" diff --git a/docs/search/criteria_reference/imageorientation_criterion.md b/docs/search/criteria_reference/imageorientation_criterion.md index 73d54f75b0a..9b0b9eb759b 100644 --- a/docs/search/criteria_reference/imageorientation_criterion.md +++ b/docs/search/criteria_reference/imageorientation_criterion.md @@ -14,34 +14,6 @@ Supported orientation values: landscape, portrait and square. ## Example -### PHP - -#### Single orientation value - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\Image\Orientation; - -$query = new Query(); -$query->query = new Orientation('image', 'landscape'); -``` - -#### Multiple orientation values - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\Image\Orientation; - -$query = new Query(); -$orientations = [ - 'landscape', - 'portrait', -]; - -$query->query = new Orientation('image', $orientations); -``` - ### REST API === "XML" diff --git a/docs/search/criteria_reference/imagewidth_criterion.md b/docs/search/criteria_reference/imagewidth_criterion.md index 63aa7708020..43841f0200e 100644 --- a/docs/search/criteria_reference/imagewidth_criterion.md +++ b/docs/search/criteria_reference/imagewidth_criterion.md @@ -11,15 +11,3 @@ The `Width` Search Criterion searches for image with specified width. - `fieldDefIdentifier` - string representing the identifier of the field - (optional) `minValue` - int representing minimum file width expressed in pixels, default: 0 - (optional) `maxValue` - int representing maximum file width expressed in pixels, default: `null` - -## Example - -### PHP - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; - -$query = new Query(); -$query->query = new Criterion\Image\Width('image', 150, 1000); -``` diff --git a/docs/search/criteria_reference/integerattribute_criterion.md b/docs/search/criteria_reference/integerattribute_criterion.md index 9981cabd3c6..a1272741147 100644 --- a/docs/search/criteria_reference/integerattribute_criterion.md +++ b/docs/search/criteria_reference/integerattribute_criterion.md @@ -13,21 +13,6 @@ The `IntegerAttribute` Search Criterion searches for products by the value of th ## Example -### PHP - -``` php -use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; -use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; - -$query = new ProductQuery( - null, - new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\IntegerAttribute( - 'size', - 38 - ) -); -``` - ### REST API === "XML" diff --git a/docs/search/criteria_reference/isbookmarked_criterion.md b/docs/search/criteria_reference/isbookmarked_criterion.md index 8d743ec4d34..2f4ce40b582 100644 --- a/docs/search/criteria_reference/isbookmarked_criterion.md +++ b/docs/search/criteria_reference/isbookmarked_criterion.md @@ -17,12 +17,6 @@ This Criterion is available only for location Search. ## Example -### PHP - -``` php -[[= include_code('code_samples/search/location/isbookmarked_criterion.php', 3, remove_indent=True) =]] -``` - ### REST API === "XML" diff --git a/docs/search/criteria_reference/iscontainer_criterion.md b/docs/search/criteria_reference/iscontainer_criterion.md index 2d3e0ff249a..e03a47cbf6e 100644 --- a/docs/search/criteria_reference/iscontainer_criterion.md +++ b/docs/search/criteria_reference/iscontainer_criterion.md @@ -10,16 +10,3 @@ The `IsContainer` Search Criterion searches for content items based on whether t ## Arguments - `value` – boolean (optional, default: `true`). If `true`, searches for content that is a container. If `false`, searches for content that is not a container. - -## Example - -### PHP - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; - -$query = new Query(); -$query->query = new Criterion\IsContainer(); // Finds containers -$query->query = new Criterion\IsContainer(false); // Finds non-containers -``` diff --git a/docs/search/criteria_reference/iscurrencyenabled_criterion.md b/docs/search/criteria_reference/iscurrencyenabled_criterion.md index d4705842110..0778fdf0fd7 100644 --- a/docs/search/criteria_reference/iscurrencyenabled_criterion.md +++ b/docs/search/criteria_reference/iscurrencyenabled_criterion.md @@ -14,15 +14,3 @@ or disabled Currencies (`false`) ## Limitations The `IsCurrencyEnabledCriterion` Criterion isn't available in Solr or Elasticsearch engines. - -## Example - -### PHP - -``` php -use Ibexa\Contracts\ProductCatalog\Values\Currency\CurrencyQuery; - -$query = new CurrencyQuery( - new \Ibexa\Contracts\ProductCatalog\Values\Currency\Query\Criterion\IsCurrencyEnabledCriterion() -); -``` diff --git a/docs/search/criteria_reference/isfieldempty_criterion.md b/docs/search/criteria_reference/isfieldempty_criterion.md index b98f6defd57..e516149a1c1 100644 --- a/docs/search/criteria_reference/isfieldempty_criterion.md +++ b/docs/search/criteria_reference/isfieldempty_criterion.md @@ -14,38 +14,11 @@ or non-empty fields (`false`) ## Limitations -The `IsFieldEmpty` Criterion isn't available in [Repository filtering](search_api.md#repository-filtering). - The Richtext field type (`ibexa_richtext`) isn't searchable in the Legacy search engine. The `IsFieldEmpty` criterion doesn't work for [Taxonomy entry assignment](taxonomyentryassignmentfield.md) fields. For this use case, use [`TaxonomyNoEntries`](taxonomy_no_entries.md) instead. -## Example - -### PHP - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; - -$query = new Query(); -$query->query = new Criterion\IsFieldEmpty('title'); -``` - ## Use case -You can use the `IsFieldEmpty` Criterion to search for articles that don't have an image: - -``` php hl_lines="8" -use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; - -$query = new LocationQuery(); -$query->query = new Criterion\LogicalAnd( - [ - new Criterion\ContentTypeIdentifier('article'), - new Criterion\IsFieldEmpty('image'), - ] -); -``` +You can use the `IsFieldEmpty` Criterion to search for articles that don't have an image, by combining it with a content type Criterion and targeting the `image` field. diff --git a/docs/search/criteria_reference/ismainlocation_criterion.md b/docs/search/criteria_reference/ismainlocation_criterion.md index 84052b3eaa8..2ed93d926e6 100644 --- a/docs/search/criteria_reference/ismainlocation_criterion.md +++ b/docs/search/criteria_reference/ismainlocation_criterion.md @@ -12,16 +12,3 @@ This Criterion is available only for Location Search. - `value` - `IsMainLocation::MAIN` (0) or `IsMainLocation::NOT_MAIN` (1), representing whether to search for a main or not main location - -## Example - -### PHP - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\Location\IsMainLocation; - -$query = new Query(); -$query->query = new Criterion\Location\IsMainLocation(IsMainLocation::MAIN); -``` diff --git a/docs/search/criteria_reference/isproductbased_criterion.md b/docs/search/criteria_reference/isproductbased_criterion.md index 507450e3e3c..9cab362f248 100644 --- a/docs/search/criteria_reference/isproductbased_criterion.md +++ b/docs/search/criteria_reference/isproductbased_criterion.md @@ -5,15 +5,3 @@ description: IsProductBased Search Criterion # IsProductBased Criterion The `IsProductBased` Search Criterion searches for content that plays the role of a Product. - -## Example - -### PHP - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; - -$query = new Query(); -$query->query = new \Ibexa\Contracts\ProductCatalog\Values\Content\Query\Criterion\IsProductBased(); -``` diff --git a/docs/search/criteria_reference/isuserbased_criterion.md b/docs/search/criteria_reference/isuserbased_criterion.md index c7d13b0cb94..24af25ecaf6 100644 --- a/docs/search/criteria_reference/isuserbased_criterion.md +++ b/docs/search/criteria_reference/isuserbased_criterion.md @@ -21,16 +21,6 @@ The `IsUserBased` Criterion isn't available in Solr or Elasticsearch engines. ## Example -### PHP - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; - -$query = new Query(); -$query->query = new Criterion\IsUserBased(); -``` - ### REST API === "XML" diff --git a/docs/search/criteria_reference/isuserenabled_criterion.md b/docs/search/criteria_reference/isuserenabled_criterion.md index d0044b117f8..5d2bd4402ad 100644 --- a/docs/search/criteria_reference/isuserenabled_criterion.md +++ b/docs/search/criteria_reference/isuserenabled_criterion.md @@ -13,16 +13,6 @@ The `IsUserEnabled` Search Criterion searches for user accounts that are enabled ## Example -### PHP - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; - -$query = new Query(); -$query->query = new Criterion\IsUserEnabled(); -``` - ### REST API === "XML" diff --git a/docs/search/criteria_reference/isvirtual_criterion.md b/docs/search/criteria_reference/isvirtual_criterion.md index 5f2bb3aa029..a0a95f90dc6 100644 --- a/docs/search/criteria_reference/isvirtual_criterion.md +++ b/docs/search/criteria_reference/isvirtual_criterion.md @@ -12,18 +12,6 @@ The `IsVirtual` Search Criterion searches for virtual or physical products. ## Example -### PHP - -``` php -use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; -use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; - -$query = new ProductQuery( - null, - new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\IsVirtual(true) -); -``` - ### REST API === "XML" diff --git a/docs/search/criteria_reference/languagecode_criterion.md b/docs/search/criteria_reference/languagecode_criterion.md index b64bb160c99..0a073437c10 100644 --- a/docs/search/criteria_reference/languagecode_criterion.md +++ b/docs/search/criteria_reference/languagecode_criterion.md @@ -13,16 +13,6 @@ The `LanguageCode` Search Criterion searches for content based on whether it's t ## Example -### PHP - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; - -$query = new Query(); -$query->query = new Criterion\LanguageCode('ger-DE', false); -``` - ### REST API === "XML" @@ -48,28 +38,4 @@ $query->query = new Criterion\LanguageCode('ger-DE', false); ## Use case You can use the `LanguageCode` Criterion to search for articles that are lacking a translation -into a specific language: - -``` php hl_lines="9" -use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; - -$query = new LocationQuery(); -$query->query = new Criterion\LogicalAnd( - [ - new Criterion\ContentTypeIdentifier('article'), - new Criterion\LogicalNot( - new Criterion\LanguageCode('ger-DE', false) - ), - ] -); - -/** @var \Ibexa\Contracts\Core\Repository\SearchService $searchService */ -$results = $searchService->findContent($query); -$articlesToTranslate = []; -foreach ($results->searchHits as $searchHit) { - $articlesToTranslate[] = $searchHit; -} - -return $articlesToTranslate; -``` +into a specific language, by negating it and setting `matchAlwaysAvailable` to `false`. diff --git a/docs/search/criteria_reference/locationid_criterion.md b/docs/search/criteria_reference/locationid_criterion.md index d3c0e762dfb..2c2b3d7345b 100644 --- a/docs/search/criteria_reference/locationid_criterion.md +++ b/docs/search/criteria_reference/locationid_criterion.md @@ -12,16 +12,6 @@ The `LocationId` Search Criterion searches for content based in the location ID. ## Example -### PHP - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; - -$query = new Query(); -$query->query = new Criterion\LocationId(62); -``` - ### REST API === "XML" diff --git a/docs/search/criteria_reference/locationremoteid_criterion.md b/docs/search/criteria_reference/locationremoteid_criterion.md index 8a6695a5a1f..b57e532c004 100644 --- a/docs/search/criteria_reference/locationremoteid_criterion.md +++ b/docs/search/criteria_reference/locationremoteid_criterion.md @@ -12,16 +12,6 @@ The `LocationRemoteId` Search Criterion searches for content based in the locati ## Example -### PHP - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; - -$query = new Query(); -$query->query = new Criterion\LocationRemoteId(['4d1e5f216c0a7aaab7f005ffd4b6a8a8', 'b81ef3e62b514188bfddd2a80d447d34']); -``` - ### REST API === "XML" diff --git a/docs/search/criteria_reference/logicaland_criterion.md b/docs/search/criteria_reference/logicaland_criterion.md index eba8a4fe4c6..0faad50cc0d 100644 --- a/docs/search/criteria_reference/logicaland_criterion.md +++ b/docs/search/criteria_reference/logicaland_criterion.md @@ -14,21 +14,6 @@ When querying for [products](product_api.md), use LogicalAnd instead. ## Example -### PHP - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; - -$query = new Query(); -$query->query = new Criterion\LogicalAnd( - [ - new Criterion\ContentTypeIdentifier('article'), - new Criterion\SectionIdentifier(['sports', 'news']), - ] -); -``` - ### REST API === "XML" diff --git a/docs/search/criteria_reference/logicalnot_criterion.md b/docs/search/criteria_reference/logicalnot_criterion.md index 20659b025e1..fe5a5b8a58e 100644 --- a/docs/search/criteria_reference/logicalnot_criterion.md +++ b/docs/search/criteria_reference/logicalnot_criterion.md @@ -14,18 +14,6 @@ It takes only one Criterion in the array parameter. ## Example -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; - -$contentTypeIdentifier = 'article'; - -$query = new Query(); -$query->filter = new Criterion\LogicalNot( - new Criterion\ContentTypeIdentifier($contentTypeIdentifier) -); -``` - ### REST API === "XML" diff --git a/docs/search/criteria_reference/logicalor_criterion.md b/docs/search/criteria_reference/logicalor_criterion.md index ddd6c536d4d..4ba749ca7db 100644 --- a/docs/search/criteria_reference/logicalor_criterion.md +++ b/docs/search/criteria_reference/logicalor_criterion.md @@ -14,21 +14,6 @@ When querying for [products](product_api.md), use LogicalOr instead. ## Example -### PHP - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; - -$query = new Query(); -$query->filter = new Criterion\LogicalOr( - [ - new Criterion\ContentTypeIdentifier('article'), - new Criterion\SectionIdentifier(['sports', 'news']), - ] -); -``` - ### REST API === "XML" diff --git a/docs/search/criteria_reference/maplocationdistance_criterion.md b/docs/search/criteria_reference/maplocationdistance_criterion.md index 1488aece523..06a5115bb14 100644 --- a/docs/search/criteria_reference/maplocationdistance_criterion.md +++ b/docs/search/criteria_reference/maplocationdistance_criterion.md @@ -18,19 +18,3 @@ The `distance` argument requires: - a list of floats for `Operator::IN` or `Operator::BETWEEN` - a single float for other Operators - -## Limitations - -The `MapLocationDistance` Criterion isn't available in [Repository filtering](search_api.md#repository-filtering). - -## Example - -### PHP - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; - -$query = new Query(); -$query->query = new Criterion\MapLocationDistance('location', Criterion\Operator::LTE, 5, 51.395973, 22.531696); -``` diff --git a/docs/search/criteria_reference/notification_datecreated_criterion.md b/docs/search/criteria_reference/notification_datecreated_criterion.md index a74bf65200b..5941cf7a3b1 100644 --- a/docs/search/criteria_reference/notification_datecreated_criterion.md +++ b/docs/search/criteria_reference/notification_datecreated_criterion.md @@ -11,11 +11,3 @@ The `DateCreated` Search Criterion searches for notifications based on the date - `created` - date to be matched, provided as a `DateTimeInterface` object - `operator` - optional operator string (GTE, LTE) - -## Example - -### PHP - -``` php hl_lines="14-15 17" -[[= include_code('code_samples/notifications/Src/Query/search.php') =]] -``` diff --git a/docs/search/criteria_reference/notification_status_criterion.md b/docs/search/criteria_reference/notification_status_criterion.md index 6dd02a2b04b..6fc86dada9a 100644 --- a/docs/search/criteria_reference/notification_status_criterion.md +++ b/docs/search/criteria_reference/notification_status_criterion.md @@ -10,11 +10,3 @@ The `Status` Search Criterion searches for notifications based on notification s ## Arguments - `status` - Boolean value that represents the status of the notification - -## Example - -### PHP - -``` php hl_lines="12" -[[= include_code('code_samples/notifications/Src/Query/search.php') =]] -``` diff --git a/docs/search/criteria_reference/notification_type_criterion.md b/docs/search/criteria_reference/notification_type_criterion.md index edc395d61c5..8f59c94ecba 100644 --- a/docs/search/criteria_reference/notification_type_criterion.md +++ b/docs/search/criteria_reference/notification_type_criterion.md @@ -10,11 +10,3 @@ The `Type` Search Criterion searches for notifications by their types. ## Arguments - `type` - string that represents the type of the notification, takes values defined in notification workflow - -## Example - -### PHP - -``` php hl_lines="11" -[[= include_code('code_samples/notifications/Src/Query/search.php') =]] -``` diff --git a/docs/search/criteria_reference/objectstateid_criterion.md b/docs/search/criteria_reference/objectstateid_criterion.md index 0ca68dc6f8d..dac8a407b97 100644 --- a/docs/search/criteria_reference/objectstateid_criterion.md +++ b/docs/search/criteria_reference/objectstateid_criterion.md @@ -12,16 +12,6 @@ The `ObjectStateId` Search Criterion searches for content based on its object st ## Example -### PHP - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; - -$query = new Query(); -$query->query = new Criterion\ObjectStateId([4, 5]); -``` - ### REST API === "XML" diff --git a/docs/search/criteria_reference/objectstateidentifier_criterion.md b/docs/search/criteria_reference/objectstateidentifier_criterion.md index 40a2bf2eebb..9102dd47cb8 100644 --- a/docs/search/criteria_reference/objectstateidentifier_criterion.md +++ b/docs/search/criteria_reference/objectstateidentifier_criterion.md @@ -13,24 +13,6 @@ The `ObjectStateIdentifier` Search Criterion searches for content based on its o ## Example -### PHP - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; - -$query = new Query(); -$query->query = new Criterion\ObjectStateIdentifier(['ready']); -``` - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; - -$query = new Query(); -$query->query = new Criterion\ObjectStateIdentifier(['not_locked'], 'ibexa_lock'); -``` - ### REST API === "XML" diff --git a/docs/search/criteria_reference/parentlocationid_criterion.md b/docs/search/criteria_reference/parentlocationid_criterion.md index 2705de87ee1..44fe3bca4a9 100644 --- a/docs/search/criteria_reference/parentlocationid_criterion.md +++ b/docs/search/criteria_reference/parentlocationid_criterion.md @@ -13,16 +13,6 @@ searches for content based on the Location ID of its parent. ## Example -### PHP - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; - -$query = new Query(); -$query->query = new Criterion\ParentLocationId([54, 58]); -``` - ### REST API === "XML" @@ -47,37 +37,4 @@ $query->query = new Criterion\ParentLocationId([54, 58]); ## Use case -You can use the `ParentLocationId` Search Criterion to list blog posts contained in a blog: - -``` php hl_lines="9" -use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; - -$locationId = 12345; - -$query = new LocationQuery(); -$query->query = new Criterion\LogicalAnd([ - new Criterion\Visibility(Criterion\Visibility::VISIBLE), - new Criterion\ParentLocationId($locationId), -]); - -/** @var \Ibexa\Contracts\Core\Repository\SearchService $searchService */ -$results = $searchService->findLocations($query); -$posts = []; -foreach ($results->searchHits as $searchHit) { - $posts[] = $searchHit; -} - -return $this->render('full/blog.html.twig', [ - 'posts' => $posts, -]); -``` - -``` html+twig -

Posts:

-
    - {% for post in posts %} -
  • {{ post.valueObject.contentInfo.name }}
  • - {% endfor %} -
-``` +You can use the `ParentLocationId` Search Criterion to list blog posts contained in a blog, by combining it with the `Visibility` Criterion so that hidden posts are excluded. diff --git a/docs/search/criteria_reference/price_currency_criterion.md b/docs/search/criteria_reference/price_currency_criterion.md index c96105d174b..33aa2e44ea4 100644 --- a/docs/search/criteria_reference/price_currency_criterion.md +++ b/docs/search/criteria_reference/price_currency_criterion.md @@ -9,19 +9,3 @@ The `Currency` Search Criterion searches for prices based on the given currency. ## Arguments - `currency` - a single object or an array of `CurrencyInterface` objects that represent the currency (`Ibexa\Contracts\ProductCatalog\Values\CurrencyInterface`) - -## Example - -### PHP - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; -use Ibexa\Contracts\ProductCatalog\Values\Price\PriceQuery; - -/** @var \Ibexa\Contracts\ProductCatalog\CurrencyServiceInterface $currencyService */ -$currency = $currencyService->getCurrencyByCode('EUR'); - -$query = new PriceQuery( - new \Ibexa\Contracts\ProductCatalog\Values\Price\Query\Criterion\Currency($currency) -); -``` diff --git a/docs/search/criteria_reference/price_customergroup_criterion.md b/docs/search/criteria_reference/price_customergroup_criterion.md index 2c33e1bd647..58bd98547f4 100644 --- a/docs/search/criteria_reference/price_customergroup_criterion.md +++ b/docs/search/criteria_reference/price_customergroup_criterion.md @@ -9,19 +9,3 @@ The `CustomerGroup` Search Criterion searches for prices based on the customer g ## Arguments - `customer_group` - a single object or an array or `CustomerGroupInterface` objects that represent the customer group (`Ibexa\Contracts\ProductCatalog\Values\CustomerGroupInterface`) - -## Example - -### PHP - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; -use Ibexa\Contracts\ProductCatalog\Values\Price\PriceQuery; - -/** @var \Ibexa\Contracts\ProductCatalog\CustomerGroupServiceInterface $customerGroupService */ -$customerGroup = $customerGroupService->getCustomerGroup(123); - -$query = new PriceQuery( - new \Ibexa\Contracts\ProductCatalog\Values\Price\Query\Criterion\CustomerGroup($customerGroup) -); -``` diff --git a/docs/search/criteria_reference/price_isbaseprice_criterion.md b/docs/search/criteria_reference/price_isbaseprice_criterion.md index 56efe39038f..626737a9370 100644 --- a/docs/search/criteria_reference/price_isbaseprice_criterion.md +++ b/docs/search/criteria_reference/price_isbaseprice_criterion.md @@ -13,16 +13,3 @@ This Criterion takes no arguments. ## Limitations The `IsBasePrice` Criterion isn't available in Solr or Elasticsearch engines. - -## Example - -### PHP - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; -use Ibexa\Contracts\ProductCatalog\Values\Price\PriceQuery; - -$query = new PriceQuery( - new \Ibexa\Contracts\ProductCatalog\Values\Price\Query\Criterion\IsBasePrice() -); -``` diff --git a/docs/search/criteria_reference/price_iscustomprice_criterion.md b/docs/search/criteria_reference/price_iscustomprice_criterion.md index 0aa2ec2afb7..331971b404a 100644 --- a/docs/search/criteria_reference/price_iscustomprice_criterion.md +++ b/docs/search/criteria_reference/price_iscustomprice_criterion.md @@ -13,16 +13,3 @@ This Criterion takes no arguments. ## Limitations The `IsCustomPrice` Criterion isn't available in Solr or Elasticsearch engines. - -## Example - -### PHP - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; -use Ibexa\Contracts\ProductCatalog\Values\Price\PriceQuery; - -$query = new PriceQuery( - new \Ibexa\Contracts\ProductCatalog\Values\Price\Query\Criterion\IsCustomPrice() -); -``` diff --git a/docs/search/criteria_reference/price_logicaland_criterion.md b/docs/search/criteria_reference/price_logicaland_criterion.md index 5d234ee1ac7..32704d4a021 100644 --- a/docs/search/criteria_reference/price_logicaland_criterion.md +++ b/docs/search/criteria_reference/price_logicaland_criterion.md @@ -9,19 +9,3 @@ The `LogicalAnd` Search Criterion matches prices if all provided Criteria match. ## Arguments - `criterion` - a set of Criteria combined by the logical operator - -## Example - -### PHP - -``` php -use Ibexa\Contracts\ProductCatalog\Values\Price\PriceQuery; - -/** @var \Ibexa\Contracts\ProductCatalog\Values\CurrencyInterface $currencyUSD */ -$query = new PriceQuery( - new \Ibexa\Contracts\ProductCatalog\Values\Price\Query\Criterion\LogicalAnd( - new \Ibexa\Contracts\ProductCatalog\Values\Price\Query\Criterion\Currency($currencyUSD), - new \Ibexa\Contracts\ProductCatalog\Values\Price\Query\Criterion\IsCustomPrice() - ) -); -``` diff --git a/docs/search/criteria_reference/price_logicalor_criterion.md b/docs/search/criteria_reference/price_logicalor_criterion.md index b650b87a80b..cdf1426aa0f 100644 --- a/docs/search/criteria_reference/price_logicalor_criterion.md +++ b/docs/search/criteria_reference/price_logicalor_criterion.md @@ -9,22 +9,3 @@ The `LogicalOr` Search Criterion matches prices if at least one of the provided ## Arguments - `criterion` - a set of Criteria combined by the logical operator - -## Example - -### PHP - -``` php -use Ibexa\Contracts\ProductCatalog\Values\Price\PriceQuery; - -/** - * @var \Ibexa\Contracts\ProductCatalog\Values\CurrencyInterface $currencyUSD - * @var \Ibexa\Contracts\ProductCatalog\Values\CurrencyInterface $currencyEUR - */ -$query = new PriceQuery( - new \Ibexa\Contracts\ProductCatalog\Values\Price\Query\Criterion\LogicalOr( - new \Ibexa\Contracts\ProductCatalog\Values\Price\Query\Criterion\Currency($currencyUSD), - new \Ibexa\Contracts\ProductCatalog\Values\Price\Query\Criterion\Currency($currencyEUR) - ) -); -``` diff --git a/docs/search/criteria_reference/price_product_criterion.md b/docs/search/criteria_reference/price_product_criterion.md index ff213b6a058..4473fac1bc9 100644 --- a/docs/search/criteria_reference/price_product_criterion.md +++ b/docs/search/criteria_reference/price_product_criterion.md @@ -9,16 +9,3 @@ The `Product` Search Criterion searches for prices based on product codes. ## Arguments - `product_code` - a string that represents a product code or an array of codes - -## Example - -### PHP - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; -use Ibexa\Contracts\ProductCatalog\Values\Price\PriceQuery; - -$query = new PriceQuery( - new \Ibexa\Contracts\ProductCatalog\Values\Price\Query\Criterion\Product('ergo_desk') -); -``` diff --git a/docs/search/criteria_reference/priority_criterion.md b/docs/search/criteria_reference/priority_criterion.md index 0c0de6b5b3e..c13d3dcc8ee 100644 --- a/docs/search/criteria_reference/priority_criterion.md +++ b/docs/search/criteria_reference/priority_criterion.md @@ -17,15 +17,3 @@ The `value` argument requires: - a list of ints for `Operator::BETWEEN` - a single int for other Operators - -## Example - -### PHP - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; - -$query = new Query(); -$query->query = new Criterion\Location\Priority(Criterion\Operator::GTE, 50); -``` diff --git a/docs/search/criteria_reference/productavailability_criterion.md b/docs/search/criteria_reference/productavailability_criterion.md index 8d726f147d8..ef746c11247 100644 --- a/docs/search/criteria_reference/productavailability_criterion.md +++ b/docs/search/criteria_reference/productavailability_criterion.md @@ -16,18 +16,6 @@ For more information, see [Availability and computed availability](products.md#a ## Example -### PHP - -``` php -use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; -use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; - -$query = new ProductQuery( - null, - new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\ProductAvailability(true) -); -``` - ### REST API === "XML" diff --git a/docs/search/criteria_reference/productcategory_criterion.md b/docs/search/criteria_reference/productcategory_criterion.md index 8ca37ebc9c1..b7c8de8bb66 100644 --- a/docs/search/criteria_reference/productcategory_criterion.md +++ b/docs/search/criteria_reference/productcategory_criterion.md @@ -12,18 +12,6 @@ The `ProductCategory` Search Criterion searches for products by the category the ## Example -### PHP - -``` php -use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; -use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; - -$query = new ProductQuery( - null, - new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\ProductCategory([2, 3]) -); -``` - ### REST API === "XML" diff --git a/docs/search/criteria_reference/productcategorysubtree_criterion.md b/docs/search/criteria_reference/productcategorysubtree_criterion.md index 10847905595..1c0831835ec 100644 --- a/docs/search/criteria_reference/productcategorysubtree_criterion.md +++ b/docs/search/criteria_reference/productcategorysubtree_criterion.md @@ -12,11 +12,3 @@ Unlike the [`ProductCategory` criterion](productcategory_criterion.md), which ma ## Arguments - `taxonomyEntryId` - int representing the ID of the root taxonomy entry (product category) of the subtree to search within - -## Example - -### PHP - -``` php -[[= include_code('code_samples/back_office/search/src/Query/ProductCategorySubtreeQuery.php') =]] -``` diff --git a/docs/search/criteria_reference/productcode_criterion.md b/docs/search/criteria_reference/productcode_criterion.md index 39d7e1b1afd..30dfbd68b2f 100644 --- a/docs/search/criteria_reference/productcode_criterion.md +++ b/docs/search/criteria_reference/productcode_criterion.md @@ -12,18 +12,6 @@ The `ProductCode` Search Criterion searches for products by their codes. ## Example -### PHP - -``` php -use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; -use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; - -$query = new ProductQuery( - null, - new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\ProductCode(['ergo_desk', 'alter_desk']) -); -``` - ### REST API === "XML" diff --git a/docs/search/criteria_reference/productname_criterion.md b/docs/search/criteria_reference/productname_criterion.md index 5a3d9a18cf3..8925d7e23e8 100644 --- a/docs/search/criteria_reference/productname_criterion.md +++ b/docs/search/criteria_reference/productname_criterion.md @@ -12,18 +12,6 @@ The `ProductName` Search Criterion searches for products by their names. ## Example -### PHP - -``` php -use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; -use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; - -$query = new ProductQuery( - null, - new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\ProductName('sofa*') -); -``` - ### REST API === "XML" diff --git a/docs/search/criteria_reference/productstock_criterion.md b/docs/search/criteria_reference/productstock_criterion.md index 710041b3611..f7e22ca20f6 100644 --- a/docs/search/criteria_reference/productstock_criterion.md +++ b/docs/search/criteria_reference/productstock_criterion.md @@ -10,27 +10,3 @@ The `ProductStock` Search Criterion searches for products by their numerical sto - `value` - the numerical stock to search for - (optional) `operator` - operator string (`=` `<` `<=` `>` `>=`) - -## Example - -### PHP - -``` php -use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; -use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; - -$productQuery = new ProductQuery( - null, - new Criterion\ProductStock(10) -); -``` - -``` php -use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; -use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; - -$productQuery = new ProductQuery( - null, - new Criterion\ProductStock(50, '>=') -); -``` diff --git a/docs/search/criteria_reference/productstockrange_criterion.md b/docs/search/criteria_reference/productstockrange_criterion.md index b185a705c80..ebeb97e09ea 100644 --- a/docs/search/criteria_reference/productstockrange_criterion.md +++ b/docs/search/criteria_reference/productstockrange_criterion.md @@ -10,17 +10,3 @@ The `ProductStockRange` Search Criterion searches for products by their numerica - `min` - minimum stock - `max` - maximum stock - -## Example - -### PHP - -``` php -use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; -use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; - -$productQuery = new ProductQuery( - null, - new Criterion\ProductStockRange(10, 120) -); -``` diff --git a/docs/search/criteria_reference/producttype_criterion.md b/docs/search/criteria_reference/producttype_criterion.md index c98fbcdc09e..18cd45cef9e 100644 --- a/docs/search/criteria_reference/producttype_criterion.md +++ b/docs/search/criteria_reference/producttype_criterion.md @@ -12,18 +12,6 @@ The `ProductType` Search Criterion searches for products by their codes. ## Example -### PHP - -``` php -use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; -use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; - -$query = new ProductQuery( - null, - new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\ProductType(['dress']) -); -``` - ### REST API === "XML" diff --git a/docs/search/criteria_reference/rangemeasurementattributemaximum_criterion.md b/docs/search/criteria_reference/rangemeasurementattributemaximum_criterion.md index 7a5a71edaea..6c9c44278d2 100644 --- a/docs/search/criteria_reference/rangemeasurementattributemaximum_criterion.md +++ b/docs/search/criteria_reference/rangemeasurementattributemaximum_criterion.md @@ -10,23 +10,3 @@ The `RangeMeasurementAttributeMaximum` Search Criterion searches for products by - `identifier` - string representing the attribute - `value` - `\Ibexa\Contracts\Measurement\Value\SimpleValueInterface` object representing the maximum attribute value - -## Example - -### PHP - -``` php -use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; -use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; - -/** @var \Ibexa\Contracts\Measurement\MeasurementServiceInterface $measurementService */ -$value = $measurementService->buildSimpleValue('length', 150, 'centimeter'); - -$query = new ProductQuery( - null, - new \Ibexa\Contracts\Measurement\Product\Query\Criterion\RangeMeasurementAttributeMaximum( - 'length', - $value - ) -); -``` diff --git a/docs/search/criteria_reference/rangemeasurementattributeminimum_criterion.md b/docs/search/criteria_reference/rangemeasurementattributeminimum_criterion.md index 7f103eee099..eb47bf9b77e 100644 --- a/docs/search/criteria_reference/rangemeasurementattributeminimum_criterion.md +++ b/docs/search/criteria_reference/rangemeasurementattributeminimum_criterion.md @@ -10,23 +10,3 @@ The `RangeMeasurementAttributeMinimum` Search Criterion searches for products by - `identifier` - string representing the attribute - `value` - `\Ibexa\Contracts\Measurement\Value\SimpleValueInterface` object representing the minimum attribute value - -## Example - -### PHP - -``` php -use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; -use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; - -/** @var \Ibexa\Contracts\Measurement\MeasurementServiceInterface $measurementService */ -$value = $measurementService->buildSimpleValue('length', 100, 'centimeter'); - -$query = new ProductQuery( - null, - new \Ibexa\Contracts\Measurement\Product\Query\Criterion\RangeMeasurementAttributeMinimum( - 'length', - $value - ) -); -``` diff --git a/docs/search/criteria_reference/remoteid_criterion.md b/docs/search/criteria_reference/remoteid_criterion.md index 5201d1b74e9..d5ae571380c 100644 --- a/docs/search/criteria_reference/remoteid_criterion.md +++ b/docs/search/criteria_reference/remoteid_criterion.md @@ -13,16 +13,6 @@ searches for content based on its remote content ID. ## Example -### PHP - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; - -$query = new Query(); -$query->query = new Criterion\RemoteId('abab615dcf26699a4291657152da4337'); -``` - ### REST API === "XML" diff --git a/docs/search/criteria_reference/search_criteria_reference.md b/docs/search/criteria_reference/search_criteria_reference.md index 0a6638217c5..d777a515d91 100644 --- a/docs/search/criteria_reference/search_criteria_reference.md +++ b/docs/search/criteria_reference/search_criteria_reference.md @@ -5,7 +5,7 @@ month_change: false # Search Criteria reference -Search Criteria are filters for content and location Search and [Repository filtering](search_api.md#repository-filtering). +Search Criteria are filters for content and location Search. Criteria can take some of the following arguments: @@ -78,8 +78,7 @@ Due to this storage limitation, searching content using the Country field type o ### Logical operators -All Logical operators are supported by Content and Location Search and -[Repository filtering](search_api.md#repository-filtering). +All Logical operators are supported by Content and Location Search. | Search Criterion | Search based on | |---------------------------------------|-------------------------------------------------------------------------------------------------| diff --git a/docs/search/criteria_reference/sectionid_criterion.md b/docs/search/criteria_reference/sectionid_criterion.md index 8116ad4e193..e0400707195 100644 --- a/docs/search/criteria_reference/sectionid_criterion.md +++ b/docs/search/criteria_reference/sectionid_criterion.md @@ -12,16 +12,6 @@ The `SectionId` Search Criterion searches for content based on the ID of the Sec ## Example -### PHP - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; - -$query = new Query(); -$query->query = new Criterion\SectionId(3); -``` - ### REST API === "XML" diff --git a/docs/search/criteria_reference/sectionidentifier_criterion.md b/docs/search/criteria_reference/sectionidentifier_criterion.md index c83e853326d..8f46c1cd828 100644 --- a/docs/search/criteria_reference/sectionidentifier_criterion.md +++ b/docs/search/criteria_reference/sectionidentifier_criterion.md @@ -12,16 +12,6 @@ The `SectionIdentifier` Search Criterion searches for content based on the ident ## Example -### PHP - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; - -$query = new Query(); -$query->query = new Criterion\SectionIdentifier(['sports', 'news']); -``` - ### REST API === "XML" diff --git a/docs/search/criteria_reference/selectionattribute_criterion.md b/docs/search/criteria_reference/selectionattribute_criterion.md index cbaf0be3648..0c59adaec6c 100644 --- a/docs/search/criteria_reference/selectionattribute_criterion.md +++ b/docs/search/criteria_reference/selectionattribute_criterion.md @@ -13,21 +13,6 @@ The `SelectionAttribute` Search Criterion searches for products by the value of ## Example -### PHP - -``` php -use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; -use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; - -$query = new ProductQuery( - null, - new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\SelectionAttribute( - 'fabric_type', - ['cotton'] - ) -); -``` - ### REST API === "XML" diff --git a/docs/search/criteria_reference/sibling_criterion.md b/docs/search/criteria_reference/sibling_criterion.md index 473fe6bbf1d..999b887c597 100644 --- a/docs/search/criteria_reference/sibling_criterion.md +++ b/docs/search/criteria_reference/sibling_criterion.md @@ -13,30 +13,6 @@ The `Sibling` Search Criterion searches for content under the same parent as the ## Example -### PHP - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; - -$query = new Query(); -$query->query = new Criterion\Sibling(59, 2); -``` - -You can also use the named constructor `Criterion\Sibling::fromLocation` and provide it with the location object: - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; - -$query = new Query(); -/** @var \Ibexa\Contracts\Core\Repository\LocationService $locationService */ -$location = $locationService->loadLocation(59); -$query->query = Criterion\Sibling::fromLocation($location); -``` - -### REST API - ### REST API === "XML" diff --git a/docs/search/criteria_reference/simplemeasurementattribute_criterion.md b/docs/search/criteria_reference/simplemeasurementattribute_criterion.md index 7cd56eb2c38..441741aad94 100644 --- a/docs/search/criteria_reference/simplemeasurementattribute_criterion.md +++ b/docs/search/criteria_reference/simplemeasurementattribute_criterion.md @@ -10,23 +10,3 @@ The `SimpleMeasurementAttribute` Search Criterion searches for products by the v - `identifier` - string representing the attribute - `value` - `Ibexa\Contracts\Measurement\Value\SimpleValueInterface` object representing the attribute value - -## Example - -### PHP - -``` php -use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; -use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; - -/** @var \Ibexa\Contracts\Measurement\MeasurementServiceInterface $measurementService */ -$value = $measurementService->buildSimpleValue('length', 120, 'centimeter'); - -$query = new ProductQuery( - null, - new \Ibexa\Contracts\Measurement\Product\Query\Criterion\SimpleMeasurementAttribute( - 'width', - $value - ) -); -``` diff --git a/docs/search/criteria_reference/subtree_criterion.md b/docs/search/criteria_reference/subtree_criterion.md index 289ca77a445..135013a78b9 100644 --- a/docs/search/criteria_reference/subtree_criterion.md +++ b/docs/search/criteria_reference/subtree_criterion.md @@ -13,16 +13,6 @@ It returns the content item and all the content items below it in the subtree. ## Example -### PHP - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; - -$query = new Query(); -$query->query = new Criterion\Subtree('/1/2/71/72/'); -``` - ### REST API === "XML" diff --git a/docs/search/criteria_reference/symbolattribute_criterion.md b/docs/search/criteria_reference/symbolattribute_criterion.md index 8b6d47f3c8e..1205fec11d4 100644 --- a/docs/search/criteria_reference/symbolattribute_criterion.md +++ b/docs/search/criteria_reference/symbolattribute_criterion.md @@ -10,11 +10,3 @@ The `SymbolAttribute` Search Criterion searches for products by [symbol attribut - `identifier` - identifier of the format - `value` - array with the values to search for - -## Example - -### PHP - -``` php -[[= include_code('code_samples/back_office/search/src/Query/SymbolAttributeTypeQuery.php') =]] -``` diff --git a/docs/search/criteria_reference/taxonomy_entry_id.md b/docs/search/criteria_reference/taxonomy_entry_id.md index e43a9d5d47c..d97414c13c4 100644 --- a/docs/search/criteria_reference/taxonomy_entry_id.md +++ b/docs/search/criteria_reference/taxonomy_entry_id.md @@ -9,25 +9,3 @@ The `TaxonomyEntryId` Search Criterion searches for content based on the ID of t ## Arguments - `value` - int(s) representing the IDs of the Tag(s) - -## Example - -### PHP - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Taxonomy\Search\Query\Criterion; - -$query = new Query(); -$query->query = new Criterion\TaxonomyEntryId(1); -``` - -Add an array of ID's to find Content tagged with at least one of the tags (OR). - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Taxonomy\Search\Query\Criterion; - -$query = new Query(); -$query->query = new Criterion\TaxonomyEntryId([1, 2, 3]); -``` diff --git a/docs/search/criteria_reference/taxonomy_no_entries.md b/docs/search/criteria_reference/taxonomy_no_entries.md index 5ea595f2f37..78299c7f8db 100644 --- a/docs/search/criteria_reference/taxonomy_no_entries.md +++ b/docs/search/criteria_reference/taxonomy_no_entries.md @@ -7,23 +7,8 @@ description: TaxonomyNoEntries Search Criterion The `TaxonomyNoEntries` Search Criterion searches for content that has no entries assigned from the specified [taxonomy](taxonomy.md). Use it when you need to find content items to which no taxonomy entries have been assigned (for example, articles without tags). -It's available for all supported search engines and in [repository filtering](search_api.md#repository-filtering). +It's available for all supported search engines. ## Arguments - `taxonomy` - `string` representing the identifier of the taxonomy (for example, `tags` or `categories`) - -## Example - -### PHP - -The following example searches for articles that have no entries assigned in the `tags` taxonomy: - -``` php hl_lines="11-16" -[[= include_code('code_samples/search/content/taxonomy_no_entries_criterion.php') =]] -``` - -The criteria limit the results to content that matches all of the conditions listed below: - -- content has no entries assigned in the `tags` taxonomy -- content type is `article` diff --git a/docs/search/criteria_reference/taxonomy_subtree.md b/docs/search/criteria_reference/taxonomy_subtree.md index 9fd3a1cfef5..a0b6e081fb2 100644 --- a/docs/search/criteria_reference/taxonomy_subtree.md +++ b/docs/search/criteria_reference/taxonomy_subtree.md @@ -9,18 +9,3 @@ The `TaxonomySubtree` Search Criterion searches for content assigned to the spec ## Arguments - `taxonomyEntryId` - `int` representing the ID of the taxonomy entry that is the root of the subtree - -## Example - -### PHP - -The following example searches for articles assigned to taxonomy entry with ID `42` or any of its child entries: - -``` php hl_lines="11-16" -[[= include_code('code_samples/search/content/taxonomy_subtree_criterion.php') =]] -``` - -The criteria limit the results to content that match all of the conditions listed below: - -- content is assigned to taxonomy entry `42` or any of its descendants -- content type is `article` diff --git a/docs/search/criteria_reference/updated_at_criterion.md b/docs/search/criteria_reference/updated_at_criterion.md index 1f12d4dfb17..4118133da45 100644 --- a/docs/search/criteria_reference/updated_at_criterion.md +++ b/docs/search/criteria_reference/updated_at_criterion.md @@ -24,12 +24,6 @@ The `UpdatedAt` Search Criterion searches for products based on the date when th ## Example -### PHP - -``` php -[[= include_code('code_samples/back_office/search/src/Query/UpdatedAtQuery.php') =]] -``` - ### REST API === "XML" diff --git a/docs/search/criteria_reference/updated_at_range_criterion.md b/docs/search/criteria_reference/updated_at_range_criterion.md index 49e5dd26fae..5dc4a9b043c 100644 --- a/docs/search/criteria_reference/updated_at_range_criterion.md +++ b/docs/search/criteria_reference/updated_at_range_criterion.md @@ -16,12 +16,6 @@ At least one of `min` or `max` must be provided. ## Example -### PHP - -``` php -[[= include_code('code_samples/back_office/search/src/Query/UpdatedAtRangeQuery.php') =]] -``` - ### REST API === "XML" diff --git a/docs/search/criteria_reference/useremail_criterion.md b/docs/search/criteria_reference/useremail_criterion.md index 72e83ba96db..276c1ade39a 100644 --- a/docs/search/criteria_reference/useremail_criterion.md +++ b/docs/search/criteria_reference/useremail_criterion.md @@ -17,24 +17,6 @@ Solr search engine and Elasticsearch support IN and EQ operators only. ## Example -### PHP - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; - -$query = new Query(); -$query->query = new Criterion\UserEmail(['johndoe']); -``` - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; - -$query = new Query(); -$query->query = new Criterion\UserEmail('nospam*', Criterion\Operator::LIKE); -``` - ### REST API === "XML" diff --git a/docs/search/criteria_reference/userid_criterion.md b/docs/search/criteria_reference/userid_criterion.md index 70dd13f9abd..72402ffdf6c 100644 --- a/docs/search/criteria_reference/userid_criterion.md +++ b/docs/search/criteria_reference/userid_criterion.md @@ -12,16 +12,6 @@ The `UserId` Search Criterion searches for content based on the User ID. ## Example -### PHP - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; - -$query = new Query(); -$query->query = new Criterion\UserId([14]); -``` - ### REST API === "XML" diff --git a/docs/search/criteria_reference/userlogin_criterion.md b/docs/search/criteria_reference/userlogin_criterion.md index 9b1b38366e5..7e2b3c9c386 100644 --- a/docs/search/criteria_reference/userlogin_criterion.md +++ b/docs/search/criteria_reference/userlogin_criterion.md @@ -17,24 +17,6 @@ Solr search engine and Elasticsearch support IN and EQ operators only. ## Example -### PHP - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; - -$query = new Query(); -$query->query = new Criterion\UserLogin(['johndoe']); -``` - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; - -$query = new Query(); -$query->query = new Criterion\UserLogin('adm*', Criterion\Operator::LIKE); -``` - ### REST API === "XML" diff --git a/docs/search/criteria_reference/usermetadata_criterion.md b/docs/search/criteria_reference/usermetadata_criterion.md index a33fd434397..1b732d0a961 100644 --- a/docs/search/criteria_reference/usermetadata_criterion.md +++ b/docs/search/criteria_reference/usermetadata_criterion.md @@ -14,16 +14,6 @@ The `UserMetadata` Search Criterion searches for content based on its creator or ## Example -### PHP - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; - -$query = new Query(); -$query->query = new Criterion\UserMetadata(Criterion\UserMetadata::GROUP, Criterion\Operator::EQ, 12); -``` - ### REST API === "XML" @@ -58,20 +48,4 @@ $query->query = new Criterion\UserMetadata(Criterion\UserMetadata::GROUP, Criter ## Use case -You can use the `UserMetadata` Criterion to search for blog posts created by the Contributor user group: - -``` php hl_lines="11" -use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; - -// ID of your custom Contributor User Group -$contributorGroupId = 32; - -$query = new LocationQuery(); -$query->query = new Criterion\LogicalAnd( - [ - new Criterion\ContentTypeIdentifier('blog_post'), - new Criterion\UserMetadata(Criterion\UserMetadata::GROUP, Criterion\Operator::EQ, $contributorGroupId), - ] -); -``` +You can use the `UserMetadata` Criterion to search for blog posts created by a specific user group, such as Contributor, by using the `GROUP` target with the `EQ` operator. diff --git a/docs/search/criteria_reference/visibility_criterion.md b/docs/search/criteria_reference/visibility_criterion.md index 6409e0e5a24..76bc3c6b0a4 100644 --- a/docs/search/criteria_reference/visibility_criterion.md +++ b/docs/search/criteria_reference/visibility_criterion.md @@ -18,16 +18,6 @@ Use Location Search to avoid this. ## Example -### PHP - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; - -$query = new Query(); -$query->query = new Criterion\Visibility(Criterion\Visibility::HIDDEN); -``` - ### REST API === "XML" diff --git a/docs/search/embeddings_reference/embeddings_reference.md b/docs/search/embeddings_reference/embeddings_reference.md index 7a78bbdb949..ffd79cb99f7 100644 --- a/docs/search/embeddings_reference/embeddings_reference.md +++ b/docs/search/embeddings_reference/embeddings_reference.md @@ -5,7 +5,7 @@ description: Embedding queries, embedding configuration, providers, and embeddin # Embeddings search reference -Embeddings provide vector representations of content or text, enabling [semantic similarity search](search_api.md#search-with-embeddings). +Embeddings provide vector representations of content or text, enabling semantic similarity search. Foundational abstractions are provided for embedding-based search, while embedding providers generate vector representations. Searching with embeddings is designed for use with the [Taxonomy suggestions](taxonomy.md#taxonomy-suggestions) feature. @@ -87,10 +87,6 @@ For a real-life example of embedding models configuration, see [Taxonomy suggest Embedding vectors are stored in dedicated search fields. These fields can be used by the search engine to perform vector similarity comparisons when embedding queries are executed. -``` php -[[= include_code('code_samples/api/public_php_api/src/embedding_fields.php') =]] -``` - - `Ibexa\Contracts\Core\Search\FieldType\EmbeddingFieldFactory` creates dedicated search fields that store embedding vectors ## Validation diff --git a/docs/search/search.md b/docs/search/search.md index 11faa82b240..f5d62a28b70 100644 --- a/docs/search/search.md +++ b/docs/search/search.md @@ -1,13 +1,19 @@ --- -description: Cohesivo search functionalities allow using search API to run complex and precise queries about content and products. +description: Cohesivo search functionalities allow running complex and precise queries about content and products. page_type: landing_page --- # Search -[[= product_name =]] exposes a very powerful [Search API](search_api.md), allowing both full-text search and querying the content repository by using several built-in Search Criteria and Sort Clauses. +[[= product_name =]] exposes a powerful search capability, allowing both full-text search +and querying the content repository by using several built-in Search Criteria and Sort Clauses. + +You build a query by combining Search Criteria, which select the content to return, +with Sort Clauses, which order the results. +Aggregations group the results into categories, +and embeddings enable semantic similarity search. +You run queries over the REST API by using the `/views` resource. [[= cards([ - "search/search_api", "search/search_criteria_and_sort_clauses", ], columns=2) =]] diff --git a/docs/search/search_api.md b/docs/search/search_api.md deleted file mode 100644 index a88e6d03d9d..00000000000 --- a/docs/search/search_api.md +++ /dev/null @@ -1,481 +0,0 @@ ---- -description: You can search for content, locations and products by using the PHP API. Fine-tune the search with Search Criteria, Sort Clauses and Aggregations. -month_change: false ---- - -# Search API - -You can search for content with the PHP API in two ways. - -To do this, you can use the [`SearchService`](#searchservice) or [Repository filtering](#repository-filtering). - -## SearchService - -`SearchService` enables you to perform search queries by using the PHP API. - -The service should be [injected into the constructor of your command or controller]([[= symfony_doc =]]/service_container.html). - -!!! tip "SearchService in the back office" - - `SearchService` is also used in the back office of [[= product_name =]], in components such as Universal Discovery Widget or Sub-items List. - -### Perform search - -To search through content you need to create a `LocationQuery` and provide your Search Criteria as a series of Criterion objects. - -For example, to search for all content of a selected content type, use one Criterion, [`Criterion\ContentTypeIdentifier`](contenttypeidentifier_criterion.md) (line 14). - -The following command takes the content type identifier as an argument and lists all results: - -``` php hl_lines="14 16" -// ... -[[= include_code('code_samples/api/public_php_api/src/Command/FindContentCommand.php', 5, 7) =]] -// ... -[[= include_code('code_samples/api/public_php_api/src/Command/FindContentCommand.php', 18, 19) =]] - // ... -[[= include_code('code_samples/api/public_php_api/src/Command/FindContentCommand.php', 33, 49) =]] -``` - -`SearchService::findContentInfo` (line 16) -retrieves `ContentInfo` objects of the found content items. -You can also use `SearchService::findContent` to get full Content objects, together with their field information. - -To query for a single result, for example by providing a Content ID, use the `SearchService::findSingle` method: - -``` php -use Ibexa\Contracts\Core\Repository\SearchService; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; -use Symfony\Component\Console\Output\OutputInterface; - -$contentId = 12345; -$criterion = new Criterion\ContentId($contentId); - -/** @var SearchService $searchService */ -$result = $searchService->findSingle($criterion); - -/** @var OutputInterface $output */ -$output->writeln($result->getName() ?? ''); -``` - -!!! tip - - For full list and details of available Search Criteria, see [Search Criteria reference](search_criteria_reference.md). - -!!! note "Search result limit" - - By default search returns up to 25 results. - You can change it by setting a different limit to the query: - - ``` php - use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; - - $query = new LocationQuery(); - $query->limit = 100; - ``` - -#### Disable result count - -By default, a search query also counts all matching results. -If you don't need the total count, set `performCount` to `false` on `Query` or `LocationQuery` to improve performance, especially for large result sets. - -``` php -[[= include_code('code_samples/api/public_php_api/src/perform_count.php', 8, 10) =]] - -[[= include_code('code_samples/api/public_php_api/src/perform_count.php', 14, 16) =]] -``` - -When `performCount` is set to `false`, `$result->totalCount` is `null`. - -#### Search with `query` and `filter` - -You can use two properties of the `Query` object to search for content: `query` and `filter`. - -In contrast to `filter`, `query` has an effect of search scoring (relevancy). -It affects default sorting if no Sort Clause is used. -As such, `query` is recommended when the search is based on user input. - -The difference between `query` and `filter` is only relevant when using Solr or Elasticsearch search engine. -With the Legacy search engine both properties give identical results. - -#### Process large result sets - -To process a large result set, use `Ibexa\Contracts\Core\Repository\Iterator\BatchIterator`. -`BatchIterator` divides the results of search or filtering into smaller batches. -This enables iterating over results that are too large to handle due to memory constraints. - -`BatchIterator` takes one of the available adapters (`\Ibexa\Contracts\Core\Repository\Iterator\BatchIteratorAdapter`) and optional batch size. For example: - -``` php -use Ibexa\Contracts\Core\Repository\Iterator\BatchIterator; -use Ibexa\Contracts\Core\Repository\Iterator\BatchIteratorAdapter; -use Ibexa\Contracts\Core\Repository\SearchService; -use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; -use Symfony\Component\Console\Output\OutputInterface; - -$query = new LocationQuery(); - -/** @var SearchService $searchService */ -$iterator = new BatchIterator(new BatchIteratorAdapter\LocationSearchAdapter($searchService, $query)); - -foreach ($iterator as $result) { - /** @var OutputInterface $output */ - $output->writeln($result->valueObject->getContentInfo()->name); -} -``` - -You can also define the batch size by setting `$iterator->setBatchSize()`. - -The following BatchIterator adapters are available, for both `query` and `filter` searches, here with the method they replace: - -| Adapter | Regular method | -|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `ContentFilteringAdapter` | `ContentService::find()` | -| `ContentInfoSearchAdapter` | `SearchService::findContentInfo()` | -| `ContentSearchAdapter` | `SearchService::findContent()` | -| `RelationListIteratorAdapter` | `ContentService::loadRelationList()` | -| `LocationFilteringAdapter` | `LocationService::find()` | -| `LocationSearchAdapter` | `SearchService::findLocations()` | -| `AttributeDefinitionFetchAdapter` | `AttributeDefinitionServiceInterface::findAttributesDefinitions()` | -| `AttributeGroupFetchAdapter` | `AttributeGroupServiceInterface::findAttributeGroups()` | -| `CurrencyFetchAdapter` | `CurrencyServiceInterface::findCurrencies()` | -| `ProductTypeListAdapter` | `ProductTypeServiceInterface::findProductTypes()` | - -## Repository filtering - -You can use the `ContentService::find(Filter)` method to find content items or `LocationService::find(Filter)` to find locations by using a defined Filter. - -`ContentService::find` returns an iterable `ContentList` while `LocationService::find` returns an iterable `LocationList`. - -Filtering differs from search. -It doesn't use the `SearchService` and isn't based on indexed data. - -`Filter` enables you to configure a query by using chained methods to select criteria, sorting, limit, and offset. - -For example, the following command lists all content items under the specified parent location and sorts them by name in descending order: - -``` php hl_lines="15-18" -// ... -[[= include_code('code_samples/api/public_php_api/src/Command/FilterCommand.php', 5, 9) =]] - -[[= include_code('code_samples/api/public_php_api/src/Command/FilterCommand.php', 20, 21) =]] - // ... -[[= include_code('code_samples/api/public_php_api/src/Command/FilterCommand.php', 34, 53) =]] -``` - -The same Filter can be applied to find locations instead of content items, for example: - -``` php hl_lines="20" -// ... -[[= include_code('code_samples/api/public_php_api/src/Command/FilterLocationCommand.php', 5, 9) =]] - -[[= include_code('code_samples/api/public_php_api/src/Command/FilterCommand.php', 20, 21) =]] - // ... -[[= include_code('code_samples/api/public_php_api/src/Command/FilterLocationCommand.php', 34, 53) =]] -``` - -!!! caution - - The total count is the total number of matched items, regardless of pagination settings. - -!!! tip "Repository filtering is SiteAccess-aware" - - Repository filtering is SiteAccess-aware, which means you can skip the second argument of the `find` methods. - In that case languages from a current context are injected and added as a LanguageCode Criterion filter. - -You can use the following methods of the Filter: - -- `withCriterion` - add the first Criterion to the Filter -- `andWithCriterion` - add another Criterion to the Filter using a LogicalAnd operation. If this is the first Criterion, this method works like `withCriterion` -- `orWithCriterion` - add a Criterion using a LogicalOr operation. If this is the first Criterion, this method works like `withCriterion` -- `withSortClause` - add a Sort Clause to the Filter -- `sliceBy` - set limit and offset for pagination -- `reset` - remove all Criteria, Sort Clauses, and pagination settings - -The following example filters for Folder content items under the parent location 2, sorts them by publication date and returns 10 results, starting from the third one: - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause; -use Ibexa\Contracts\Core\Repository\Values\Filter\Filter; - -$filter = new Filter(); -$filter - ->withCriterion(new Criterion\ContentTypeIdentifier('folder')) - ->andWithCriterion(new Criterion\ParentLocationId(2)) - ->withSortClause(new SortClause\DatePublished(Query::SORT_ASC)) - ->sliceBy(10, 2); -``` - -!!! note "Search Criteria and Sort Clause availability" - - Not all Search Criteria and Sort Clauses are available for use in repository filtering. - - Only Criteria implementing `FilteringCriterion` and Sort Clauses implementing `FilteringSortClause` are supported. - - See [Search Criteria](search_criteria_reference.md) and [Sort Clause reference](sort_clause_reference.md) for details. - -!!! tip - - It's recommended to use an IDE that can recognize type hints when working with Repository Filtering. - If you try to use an unsupported Criterion or Sort Clause, the IDE indicates an issue. - -## Search in controller - -You can use the `SearchService` or repository filtering in a controller, as long as you provide the required parameters. -For example, in the code below, `locationId` is provided to list all children of a location by using the `SearchService`. - -``` php hl_lines="22-24" -// ... -[[= include_code('code_samples/api/public_php_api/src/Controller/CustomController.php', 5, 12) =]] - // ... -[[= include_code('code_samples/api/public_php_api/src/Controller/CustomController.php', 17, 32) =]] -``` - -The rendering of results is then relegated to templates (lines 22-24). - -When using Repository filtering, provide the results of `ContentService::find()` as parameters to the view: - -``` php hl_lines="19" -// ... -[[= include_code('code_samples/api/public_php_api/src/Controller/CustomFilterController.php', 5, 12) =]] - // ... -[[= include_code('code_samples/api/public_php_api/src/Controller/CustomFilterController.php', 17, 31) =]] -``` - -### Paginate search results - -To paginate search or filtering results, it's recommended to use the [Pagerfanta library](https://github.com/BabDev/Pagerfanta) and [[[= product_name =]]'s adapters for it.](https://github.com/ibexa/core/blob/6.0/src/lib/Pagination/Pagerfanta/Pagerfanta.php) - -``` php -// ... -[[= include_code('code_samples/api/public_php_api/src/Controller/PaginationController.php', 9, 15) =]] - // ... -[[= include_code('code_samples/api/public_php_api/src/Controller/PaginationController.php', 20, 39) =]] -``` - -Pagination can then be rendered for example using the following template: - -``` html+twig -[[= include_code('code_samples/api/public_php_api/templates/themes/standard/full/custom_pagination.html.twig') =]] -``` - -For more information and examples, see [PagerFanta documentation](https://www.babdev.com/open-source/packages/pagerfanta/docs/3.x/usage). - -#### Pagerfanta adapters - -| Adapter class name | Description | -|----------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| [`ContentSearchAdapter`](https://github.com/ibexa/core/blob/6.0/src/lib/Pagination/Pagerfanta/ContentSearchAdapter.php) | Makes a search against passed Query and returns `Content` objects. | -| [`ContentSearchHitAdapter`](https://github.com/ibexa/core/blob/6.0/src/lib/Pagination/Pagerfanta/ContentSearchHitAdapter.php) | Makes a search against passed Query and returns `SearchHit` objects instead. | -| [`LocationSearchAdapter`](https://github.com/ibexa/core/blob/6.0/src/lib/Pagination/Pagerfanta/LocationSearchAdapter.php) | Makes a location search against passed Query and returns `Location` objects. | -| [`LocationSearchHitAdapter`](https://github.com/ibexa/core/blob/6.0/src/lib/Pagination/Pagerfanta/LocationSearchHitAdapter.php) | Makes a location search against passed Query and returns `SearchHit` objects instead. | -| [`ContentFilteringAdapter`](https://github.com/ibexa/core/blob/6.0/src/lib/Pagination/Pagerfanta/ContentFilteringAdapter.php) | Applies a Content filter and returns a `ContentList` object. | -| [`LocationFilteringAdapter`](https://github.com/ibexa/core/blob/6.0/src/lib/Pagination/Pagerfanta/LocationFilteringAdapter.php) | Applies a location filter and returns a `LocationList` object. | -| `AttributeDefinitionListAdapter` | Makes a search for product attributes and returns an `AttributeDefinitionListInterface` object. | -| `AttributeGroupListAdapter` | Makes a search for product attribute groups and returns an `AttributeGroupListInterface` object. | -| `CurrencyListAdapter` | Makes a search for currencies and returns a `CurrencyListInterface` object. | -| `CustomPricesAdapter` | Makes a search for custom prices and returns a `CustomPrice` object. | -| `CustomerGroupListAdapter` | Makes a search for customer groups and returns a `CustomerGroupListInterface` object. | -| `ProductListAdapter` | Makes a search for products and returns a `ProductListInterface` object. | -| `ProductTypeListAdapter` | Makes a search for product types and returns a `ProductTypeListInterface` object. | -| `RegionListAdapter` | Makes a search for regions and returns a `RegionListInterface` object. | -| `ShoppingListAdapter` | Makes a search for shopping lists and returns a `ShoppingListCollectionInterface` object. | - -## Complex search - -For more complex searches, you need to combine multiple Criteria. -You can do it using logical operators: `LogicalAnd`, `LogicalOr`, and `LogicalNot`. - -``` php -[[= include_code('code_samples/api/public_php_api/src/Command/FindComplexCommand.php', 45, 49) =]] -[[= include_code('code_samples/api/public_php_api/src/Command/FindComplexCommand.php', 54, 54) =]] - -[[= include_code('code_samples/api/public_php_api/src/Command/FindComplexCommand.php', 61, 65) =]] -``` - -This example takes three parameters from a command — `$text`, `$contentTypeId`, and `$locationId`. -It then combines them using `Criterion\LogicalAnd` to search for content items -that belong to a specific subtree, have the chosen content type and contain the provided text (lines 3-6). - -This also shows that you can get the total number of search results using the `totalCount` property of search results (line 9). - -You can also nest different operators to construct more complex queries. -The example below uses the `LogicalNot` operator to search for all content containing a given phrase -that doesn't belong to the provided Section: - -``` php -[[= include_code('code_samples/api/public_php_api/src/Command/FindComplexCommand.php', 47, 54, remove_indent=True) =]] -``` - -### Combine independent Criteria - -Criteria are independent of one another. -This can lead to unexpected behavior, for instance because content can have multiple locations. - -For example, a content item has two locations: visible location A and hidden location B. -You perform the following query: - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\LocationId; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\Visibility; - -$query = new LocationQuery(); -$bLocationId = 12345; -$query->filter = new Criterion\LogicalAnd([ - new LocationId($bLocationId), - new Visibility(Visibility::VISIBLE), -]); -``` - -The query searches for location B by using the [`LocationId` Criterion](locationid_criterion.md), and for visible content by using the [`Visibility` Criterion](visibility_criterion.md). - -Even though the location B is hidden, the query finds the content because both conditions are satisfied: - -- the content item has location B -- the content item is visible (it has the visible location A) - -## Sort results - -To sort the results of a query, use one of more [Sort Clauses](sort_clause_reference.md). - -For example, to order search results by their publication date, from oldest to newest, and then alphabetically by content name, add the following Sort Clauses to the query: - -``` php -[[= include_code('code_samples/api/public_php_api/src/Command/FindComplexCommand.php', 56, 59, remove_indent=True) =]] -``` - -!!! tip - - For the full list and details of available Sort Clauses, see [Sort Clause reference](sort_clause_reference.md). - -## Aggregation - -!!! caution "Feature support" - - Aggregation is only available in the Solr and Elasticsearch search engines. - -With aggregations you can find the count of search results or other result information for each Aggregation type. - -To do this, you use of the query's `$aggregations` property: - -``` php -[[= include_code('code_samples/api/public_php_api/src/Command/FindWithAggregationCommand.php', 31, 35, remove_indent=True) =]] -``` - -The name of the aggregation must be unique in the given query. - -Access the results by using the `get()` method of the aggregation: - -``` php -[[= include_code('code_samples/api/public_php_api/src/Command/FindWithAggregationCommand.php', 40, 40, remove_indent=True) =]] -``` - -Aggregation results contain the name of the result and the count of found items: - -``` php -[[= include_code('code_samples/api/public_php_api/src/Command/FindWithAggregationCommand.php', 43, 45, remove_indent=True) =]] -``` - -With field aggregations you can group search results according to the value of a specific field. -In this case the aggregation takes the content type identifier and the field identifier as parameters. - -The following example creates an aggregation named `selection` that groups results according to the value of the `topic` field in the `article` content type: - -``` php -[[= include_code('code_samples/api/public_php_api/src/Command/FindWithAggregationCommand.php', 36, 36, remove_indent=True) =]] -``` - -With term aggregation you can define additional limits to the results. -The following example limits the number of terms returned to 5 and only considers terms that have 10 or more results: - -``` php -[[= include_code('code_samples/api/public_php_api/src/Command/FindWithAggregationCommand.php', 31, 33, remove_indent=True) =]] -``` - -To use a range aggregation, you must provide a `ranges` array containing a set of `Range` objects that define the borders of the specific range sets. - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation\Field\IntegerRangeAggregation; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation\Range; - -$ranges = [ - Range::ofInt(1, 30), - Range::ofInt(30, 60), - Range::ofInt(60, null), -]; - -$query = new LocationQuery(); -$query->aggregations[] = new IntegerRangeAggregation('range', 'person', 'age', $ranges); -``` - -!!! note - - The beginning of the range is included and the end is excluded, so a range between 1 and 30 includes value `1`, but not `30`. - - `null` means that a range doesn't have an end. - In the example all values above (and including) 60 are included in the last range. - -See [Aggregation reference](aggregation_reference.md) for details of all available aggregations. - -## Search with embeddings - -!!! note "Feature support" - - Searching with embeddings requires a search engine that supports it, such as Elasticsearch or Solr 9.8.1+. - -Embeddings are numerical representations that capture the meaning of text, images, or other content. -AI providers generate embeddings by converting words or documents into lists of numbers, instead of treating them as plain text. -Such lists, aka vectors, can then be compared to find content with similar meaning. - -Searching with embeddings enables matching content based on meaning rather than exact text matches. -Instead of comparing keywords, the system compares vectors that represent the semantic meaning of content and the query input. - -!!! note "Taxonomy suggestions" - - Embedding queries have been introduced primarily to support the [Taxonomy suggestions](taxonomy.md#taxonomy-suggestions) feature, therefore embedding search integration is provided for `TaxonomyEmbedding`. - -You can narrow down the search results, for example, by content type or location. -To do this, combine searching with embeddings with filters. -Repository search also respects the permissions of the current user. - -An embedding query is represented by the `Ibexa\Contracts\Core\Repository\Values\Content\EmbeddingQuery` value object. -The object encapsulates the embedding used for similarity search and optional search parameters such as filtering, pagination, aggregations, and result counting. - -### Use embedding queries in search - -Embedding queries are executed through the search API in the same way as other search requests. -You build an `EmbeddingQuery` instance by using a builder and pass it to the search service. - -This example shows a minimal embedding query executed directly through the search service: - -``` php hl_lines="38-39 41-47 49" -[[= include_code('code_samples/api/public_php_api/src/Command/FindByTaxonomyEmbeddingCommand.php') =]] -``` - -For more information, see [Embeddings reference](embeddings_reference.md). - -## Search in trash - -In the user interface, on the **Trash** screen, you can search for content items, and then sort the results based on different criteria. -To search the trash with the API, use the `TrashService::findInTrash` method to submit a query for content items that are held in trash. -Searching in trash supports a limited set of Criteria and Sort Clauses. -For a list of supported Criteria and Sort Clauses, see [Search in trash reference](search_in_trash_reference.md). - -!!! note - - Searching through the trashed content items operates directly on the database, therefore you cannot use external search engines, such as Solr or Elasticsearch, and it's impossible to reindex the data. - -``` php -[[= include_code('code_samples/api/public_php_api/src/Command/FindInTrashCommand.php', 5, 6) =]] -//... -[[= include_code('code_samples/api/public_php_api/src/Command/FindInTrashCommand.php', 36, 42, remove_indent=True) =]] -``` - -!!! caution - - Make sure that you set the Criterion on the `filter` property. - It's impossible to use the `query` property, because the search in trash operation filters the database instead of querying. diff --git a/docs/search/search_criteria_and_sort_clauses.md b/docs/search/search_criteria_and_sort_clauses.md index f1dbace0de9..c3e7d6096b7 100644 --- a/docs/search/search_criteria_and_sort_clauses.md +++ b/docs/search/search_criteria_and_sort_clauses.md @@ -7,7 +7,6 @@ description: Search Criteria and Sort Clauses help you fine-tune searches done b Search Criteria and Sort Clauses are value object classes used for building a search query, to define filter criteria and ordering of the result set. [[= product_name =]] provides a number of standard Search Criteria and Sort Clauses that you can use out of the box and that should cover the majority of use cases. -For an example of how to use and combine Criteria and Sort Clauses, refer to [Searching in PHP API](search_api.md). ## Search engine handling of Search Criteria and Sort Clauses @@ -79,7 +78,7 @@ Available tags for Sort Clause handlers in Legacy Storage Engine are: - for Criterion handlers: `ibexa.core.trash.search.legacy.gateway.criterion_handler` - for Sort Clause handlers: `ibexa.core.trash.search.legacy.gateway.sort_clause_handler` - For more information about searching for content items in Trash, see [Search in trash](search_api.md#search-in-trash). + For more information about searching for content items in Trash, see [Search in trash](search_in_trash_reference.md). For more information about the Criteria and Sort Clauses that are supported when searching for trashed content items, see [Searching in trash reference](search_in_trash_reference.md). diff --git a/docs/search/search_in_trash_reference.md b/docs/search/search_in_trash_reference.md index 95a04de6a3e..47340606522 100644 --- a/docs/search/search_in_trash_reference.md +++ b/docs/search/search_in_trash_reference.md @@ -6,7 +6,7 @@ month_change: false # Search in trash reference -When you [search for content items that are held in trash](search_api.md#search-in-trash), you can apply only a limited subset of Search Criteria and Sort Clauses +When you search for content items that are held in trash, you can apply only a limited subset of Search Criteria and Sort Clauses which can be used by `Ibexa\Contracts\Core\Repository\TrashService::findTrashItems`. Some sort clauses are exclusive to trash search. diff --git a/docs/search/sort_clause_reference/baseprice_sort_clause.md b/docs/search/sort_clause_reference/baseprice_sort_clause.md index b19edc4e071..0cd32456082 100644 --- a/docs/search/sort_clause_reference/baseprice_sort_clause.md +++ b/docs/search/sort_clause_reference/baseprice_sort_clause.md @@ -14,19 +14,3 @@ The `BasePrice` Sort Clause sorts search results by the product's base price. ## Limitations The `BasePrice` Sort Clause isn't available in the Legacy Search engine. - -## Example - -``` php -use Ibexa\Contracts\ProductCatalog\Values\CurrencyInterface; -use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; - -/** @var CurrencyInterface $currency */ -$sortClauses = [ - new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\SortClause\BasePrice( - $currency, - ProductQuery::SORT_ASC - ), -]; -$productQuery = new ProductQuery(null, null, $sortClauses); -``` diff --git a/docs/search/sort_clause_reference/contentid_sort_clause.md b/docs/search/sort_clause_reference/contentid_sort_clause.md index dc240e31a89..c7fb7febdc5 100644 --- a/docs/search/sort_clause_reference/contentid_sort_clause.md +++ b/docs/search/sort_clause_reference/contentid_sort_clause.md @@ -9,13 +9,3 @@ The `ContentId` Sort Clause sorts search results by the content items' IDs. ## Arguments [[= include_file('docs/snippets/sort_direction.md') =]] - -## Example - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause; - -$query = new LocationQuery(); -$query->sortClauses = [new SortClause\ContentId()]; -``` diff --git a/docs/search/sort_clause_reference/contentname_sort_clause.md b/docs/search/sort_clause_reference/contentname_sort_clause.md index 400c72b37ff..59353da582d 100644 --- a/docs/search/sort_clause_reference/contentname_sort_clause.md +++ b/docs/search/sort_clause_reference/contentname_sort_clause.md @@ -9,13 +9,3 @@ The `ContentName` Sort Clause sorts search results by the content items' names. ## Arguments [[= include_file('docs/snippets/sort_direction.md') =]] - -## Example - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause; - -$query = new LocationQuery(); -$query->sortClauses = [new SortClause\ContentName()]; -``` diff --git a/docs/search/sort_clause_reference/contenttranslatedname_sort_clause.md b/docs/search/sort_clause_reference/contenttranslatedname_sort_clause.md index 2b39ee39b95..0e17974bfba 100644 --- a/docs/search/sort_clause_reference/contenttranslatedname_sort_clause.md +++ b/docs/search/sort_clause_reference/contenttranslatedname_sort_clause.md @@ -9,17 +9,3 @@ The `ContentTranslatedName` Sort Clause sorts search results by the content item ## Arguments [[= include_file('docs/snippets/sort_direction.md') =]] - -## Limitations - -The `ContentTranslatedName` Sort Clause isn't available in [Repository filtering](search_api.md#repository-filtering). - -## Example - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause; - -$query = new LocationQuery(); -$query->sortClauses = [new SortClause\ContentTranslatedName()]; -``` diff --git a/docs/search/sort_clause_reference/contenttypename_sort_clause.md b/docs/search/sort_clause_reference/contenttypename_sort_clause.md index 7199f30b83b..00d67e36d8f 100644 --- a/docs/search/sort_clause_reference/contenttypename_sort_clause.md +++ b/docs/search/sort_clause_reference/contenttypename_sort_clause.md @@ -9,13 +9,3 @@ The `ContentTypeName` Sort Clause sorts the results of searching in Trash by the ## Arguments - (optional) `sortDirection` - Query constant, either `Query::SORT_ASC` or `Query::SORT_DESC` - -## Example - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause; - -$query = new Query(); -$query->sortClauses = [new SortClause\Trash\ContentTypeName()]; -``` diff --git a/docs/search/sort_clause_reference/createdat_sort_clause.md b/docs/search/sort_clause_reference/createdat_sort_clause.md index f68a4944fa7..6265a6ed607 100644 --- a/docs/search/sort_clause_reference/createdat_sort_clause.md +++ b/docs/search/sort_clause_reference/createdat_sort_clause.md @@ -9,19 +9,3 @@ The `CreatedAt` Sort Clause sorts search results by the date and time of the cre ## Arguments - (optional) `sortDirection` - `CreatedAt` constant, either `CreatedAt::SORT_ASC` or `CreatedAt::SORT_DESC` - -## Example - -``` php -use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; - -$productQuery = new ProductQuery( - null, - null, - [ - new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\SortClause\CreatedAt( - \Ibexa\Contracts\ProductCatalog\Values\Product\Query\SortClause\CreatedAt::SORT_ASC - ), - ] -); -``` diff --git a/docs/search/sort_clause_reference/customfield_sort_clause.md b/docs/search/sort_clause_reference/customfield_sort_clause.md index aa133fb8ae4..92a8301c90e 100644 --- a/docs/search/sort_clause_reference/customfield_sort_clause.md +++ b/docs/search/sort_clause_reference/customfield_sort_clause.md @@ -17,15 +17,3 @@ The `CustomField` Sort Clause sorts search results by raw search index fields. To keep your project search engine independent, don't use the `CustomField` Sort Clause in production code. Valid use cases are: testing, or temporary (one-off) tools. - -The `CustomField` Sort Clause isn't available in [Repository filtering](search_api.md#repository-filtering). - -## Example - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause; - -$query = new LocationQuery(); -$query->sortClauses = [new SortClause\CustomField('my_custom_field_s')]; -``` diff --git a/docs/search/sort_clause_reference/customprice_sort_clause.md b/docs/search/sort_clause_reference/customprice_sort_clause.md index 3d8fdc15f02..877585063d6 100644 --- a/docs/search/sort_clause_reference/customprice_sort_clause.md +++ b/docs/search/sort_clause_reference/customprice_sort_clause.md @@ -16,24 +16,3 @@ If you don't provide a customer group, the query uses the group related to the c ## Limitations The `CustomPrice` Sort Clause isn't available in the Legacy Search engine. - -## Example - -``` php -use Ibexa\Contracts\ProductCatalog\Values\CurrencyInterface; -use Ibexa\Contracts\ProductCatalog\Values\CustomerGroupInterface; -use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; - -/** - * @var CurrencyInterface $currency - * @var CustomerGroupInterface $customerGroup - */ -$sortClauses = [ - new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\SortClause\CustomPrice( - $currency, - ProductQuery::SORT_ASC, - $customerGroup - ), -]; -$productQuery = new ProductQuery(null, null, $sortClauses); -``` diff --git a/docs/search/sort_clause_reference/datemodified_sort_clause.md b/docs/search/sort_clause_reference/datemodified_sort_clause.md index 5d53e704f81..895060e685b 100644 --- a/docs/search/sort_clause_reference/datemodified_sort_clause.md +++ b/docs/search/sort_clause_reference/datemodified_sort_clause.md @@ -9,13 +9,3 @@ The `DateModified` Sort Clause sorts search results by the date and time of the ## Arguments [[= include_file('docs/snippets/sort_direction.md') =]] - -## Example - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause; - -$query = new LocationQuery(); -$query->sortClauses = [new SortClause\DateModified()]; -``` diff --git a/docs/search/sort_clause_reference/datepublished_sort_clause.md b/docs/search/sort_clause_reference/datepublished_sort_clause.md index a16134bc9d5..f6c0edfdf86 100644 --- a/docs/search/sort_clause_reference/datepublished_sort_clause.md +++ b/docs/search/sort_clause_reference/datepublished_sort_clause.md @@ -9,13 +9,3 @@ The `DatePublished` Sort Clause sorts search results by the date and time of the ## Arguments [[= include_file('docs/snippets/sort_direction.md') =]] - -## Example - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause; - -$query = new LocationQuery(); -$query->sortClauses = [new SortClause\DatePublished()]; -``` diff --git a/docs/search/sort_clause_reference/datetrashed_sort_clause.md b/docs/search/sort_clause_reference/datetrashed_sort_clause.md index 18d31dc623a..99437b28b91 100644 --- a/docs/search/sort_clause_reference/datetrashed_sort_clause.md +++ b/docs/search/sort_clause_reference/datetrashed_sort_clause.md @@ -9,13 +9,3 @@ The `DateTrashed` Sort Clause sorts the results of searching in Trash by the dat ## Arguments - (optional) `sortDirection` - Query constant, either `Query::SORT_ASC` or `Query::SORT_DESC` - -## Example - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause; - -$query = new Query(); -$query->sortClauses = [new SortClause\Trash\DateTrashed()]; -``` diff --git a/docs/search/sort_clause_reference/depth_sort_clause.md b/docs/search/sort_clause_reference/depth_sort_clause.md index 3fd794ec982..829f03fd1e1 100644 --- a/docs/search/sort_clause_reference/depth_sort_clause.md +++ b/docs/search/sort_clause_reference/depth_sort_clause.md @@ -9,13 +9,3 @@ The `Location\Depth` Sort Clause sorts search results by the depth of the locati ## Arguments [[= include_file('docs/snippets/sort_direction.md') =]] - -## Example - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause; - -$query = new LocationQuery(); -$query->sortClauses = [new SortClause\Location\Depth()]; -``` diff --git a/docs/search/sort_clause_reference/field_sort_clause.md b/docs/search/sort_clause_reference/field_sort_clause.md index d5e46ecf35a..fd0a8de4101 100644 --- a/docs/search/sort_clause_reference/field_sort_clause.md +++ b/docs/search/sort_clause_reference/field_sort_clause.md @@ -13,17 +13,3 @@ Results of the query that don't belong to the content type are ranked lower. - `typeIdentifier` - string representing the identifier of the content type to which the field belongs - `fieldIdentifier` - string representing the identifier of the field to sort by [[= include_file('docs/snippets/sort_direction.md') =]] - -## Limitations - -The `Field` Sort Clause isn't available in [Repository filtering](search_api.md#repository-filtering). - -## Example - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause; - -$query = new LocationQuery(); -$query->sortClauses = [new SortClause\Field('article', 'title')]; -``` diff --git a/docs/search/sort_clause_reference/id_sort_clause.md b/docs/search/sort_clause_reference/id_sort_clause.md index 02cc04d06d3..11d064c4f4e 100644 --- a/docs/search/sort_clause_reference/id_sort_clause.md +++ b/docs/search/sort_clause_reference/id_sort_clause.md @@ -9,13 +9,3 @@ The `Location\Id` Sort Clause sorts search results by the ID of the location. ## Arguments [[= include_file('docs/snippets/sort_direction.md') =]] - -## Example - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause; - -$query = new LocationQuery(); -$query->sortClauses = [new SortClause\Location\Id()]; -``` diff --git a/docs/search/sort_clause_reference/ismainlocation_sort_clause.md b/docs/search/sort_clause_reference/ismainlocation_sort_clause.md index 2dd25bfd8c4..5300e808a03 100644 --- a/docs/search/sort_clause_reference/ismainlocation_sort_clause.md +++ b/docs/search/sort_clause_reference/ismainlocation_sort_clause.md @@ -11,17 +11,3 @@ Locations that aren't main locations are ranked as lower values (for example, wi ## Arguments [[= include_file('docs/snippets/sort_direction.md') =]] - -## Limitations - -The `Location\IsMainLocation` Sort Clause isn't available in [Repository filtering](search_api.md#repository-filtering). - -## Example - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause; - -$query = new LocationQuery(); -$query->sortClauses = [new SortClause\Location\IsMainLocation()]; -``` diff --git a/docs/search/sort_clause_reference/maplocationdistance_sort_clause.md b/docs/search/sort_clause_reference/maplocationdistance_sort_clause.md index 07a156f4478..32454bec83d 100644 --- a/docs/search/sort_clause_reference/maplocationdistance_sort_clause.md +++ b/docs/search/sort_clause_reference/maplocationdistance_sort_clause.md @@ -12,17 +12,3 @@ The `MapLocationDistance` Sort Clause sorts search results by the distance of th - `fieldIdentifier` - string representing the identifier of the MapLocation field to sort by - `latitude` - float representing the latitude of the location to calculate distance to - `longitude`- float representing the longitude of the location to calculate distance to [[= include_file('docs/snippets/sort_direction.md') =]] - -## Limitations - -The `MapLocationDistance` Sort Clause isn't available in [Repository filtering](search_api.md#repository-filtering). - -## Example - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause; - -$query = new LocationQuery(); -$query->sortClauses = [new SortClause\MapLocationDistance('place', 'location', 49.542889, 20.111349)]; -``` diff --git a/docs/search/sort_clause_reference/path_sort_clause.md b/docs/search/sort_clause_reference/path_sort_clause.md index 2a2f67dd2eb..6e1a813c1c7 100644 --- a/docs/search/sort_clause_reference/path_sort_clause.md +++ b/docs/search/sort_clause_reference/path_sort_clause.md @@ -13,13 +13,3 @@ The `Location\Path` Sort Clause sorts search results by the pathString of the lo ## Arguments [[= include_file('docs/snippets/sort_direction.md') =]] - -## Example - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause; - -$query = new LocationQuery(); -$query->sortClauses = [new SortClause\Location\Path()]; -``` diff --git a/docs/search/sort_clause_reference/priority_sort_clause.md b/docs/search/sort_clause_reference/priority_sort_clause.md index 46b871da382..05ffcc3d445 100644 --- a/docs/search/sort_clause_reference/priority_sort_clause.md +++ b/docs/search/sort_clause_reference/priority_sort_clause.md @@ -9,13 +9,3 @@ The `Location\Priority` Sort Clause sorts search results by the priority of the ## Arguments [[= include_file('docs/snippets/sort_direction.md') =]] - -## Example - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause; - -$query = new LocationQuery(); -$query->sortClauses = [new SortClause\Location\Priority()]; -``` diff --git a/docs/search/sort_clause_reference/productavailability_sort_clause.md b/docs/search/sort_clause_reference/productavailability_sort_clause.md index 9ef70c1406d..a2b381da36e 100644 --- a/docs/search/sort_clause_reference/productavailability_sort_clause.md +++ b/docs/search/sort_clause_reference/productavailability_sort_clause.md @@ -9,17 +9,3 @@ The `ProductAvailability` Sort Clause sorts search results by whether they have ## Arguments [[= include_file('docs/snippets/sort_direction.md') =]] - -## Example - -``` php -use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; - -$query = new ProductQuery( - null, - null, - [ - new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\SortClause\ProductAvailability(), - ] -); -``` diff --git a/docs/search/sort_clause_reference/productcode_sort_clause.md b/docs/search/sort_clause_reference/productcode_sort_clause.md index 8b205822345..9d3070ed193 100644 --- a/docs/search/sort_clause_reference/productcode_sort_clause.md +++ b/docs/search/sort_clause_reference/productcode_sort_clause.md @@ -9,17 +9,3 @@ The `ProductCode` Sort Clause sorts search results by the product code. ## Arguments [[= include_file('docs/snippets/sort_direction.md') =]] - -## Example - -``` php -use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; - -$query = new ProductQuery( - null, - null, - [ - new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\SortClause\ProductCode(), - ] -); -``` diff --git a/docs/search/sort_clause_reference/productname_sort_clause.md b/docs/search/sort_clause_reference/productname_sort_clause.md index a7f8b4c3cdc..cbf01bcfdac 100644 --- a/docs/search/sort_clause_reference/productname_sort_clause.md +++ b/docs/search/sort_clause_reference/productname_sort_clause.md @@ -9,17 +9,3 @@ The `ProductName` Sort Clause sorts search results by the Product code. ## Arguments [[= include_file('docs/snippets/sort_direction.md') =]] - -## Example - -``` php -use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; - -$query = new ProductQuery( - null, - null, - [ - new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\SortClause\ProductName(), - ] -); -``` diff --git a/docs/search/sort_clause_reference/random_sort_clause.md b/docs/search/sort_clause_reference/random_sort_clause.md index 5b3c4d8fbd7..155181b04eb 100644 --- a/docs/search/sort_clause_reference/random_sort_clause.md +++ b/docs/search/sort_clause_reference/random_sort_clause.md @@ -13,15 +13,4 @@ The `Random` Sort Clause orders search results randomly. ## Limitations -The `Random` Sort Clause isn't available in [Repository filtering](search_api.md#repository-filtering). In Elasticsearch engine, you cannot combine the `Random` Sort Clause with any other Sort Clause. - -## Example - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause; - -$query = new LocationQuery(); -$query->sortClauses = [new SortClause\Random()]; -``` diff --git a/docs/search/sort_clause_reference/score_sort_clause.md b/docs/search/sort_clause_reference/score_sort_clause.md index 460915f4437..457a357abb4 100644 --- a/docs/search/sort_clause_reference/score_sort_clause.md +++ b/docs/search/sort_clause_reference/score_sort_clause.md @@ -9,17 +9,3 @@ The `Score` Sort Clause orders search results by their score. ## Arguments [[= include_file('docs/snippets/sort_direction.md') =]] - -## Limitations - -The `Score` Sort Clause isn't available in [Repository filtering](search_api.md#repository-filtering). - -## Example - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause; - -$query = new LocationQuery(); -$query->sortClauses = [new SortClause\Score()]; -``` diff --git a/docs/search/sort_clause_reference/sectionidentifier_sort_clause.md b/docs/search/sort_clause_reference/sectionidentifier_sort_clause.md index 2f4f82e9b18..e7861c2ff98 100644 --- a/docs/search/sort_clause_reference/sectionidentifier_sort_clause.md +++ b/docs/search/sort_clause_reference/sectionidentifier_sort_clause.md @@ -13,13 +13,3 @@ The `SectionIdentifier` Sort Clause sorts search results by the Section IDs of t !!! note Solr search engine uses the `Query::SORT_DESC` sort direction by default. - -## Example - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause; - -$query = new LocationQuery(); -$query->sortClauses = [new SortClause\SectionIdentifier()]; -``` diff --git a/docs/search/sort_clause_reference/sectionname_sort_clause.md b/docs/search/sort_clause_reference/sectionname_sort_clause.md index 912a4b1217b..97d1c764d95 100644 --- a/docs/search/sort_clause_reference/sectionname_sort_clause.md +++ b/docs/search/sort_clause_reference/sectionname_sort_clause.md @@ -9,13 +9,3 @@ The `SectionName` Sort Clause sorts search results by the Section name of the co ## Arguments [[= include_file('docs/snippets/sort_direction.md') =]] - -## Example - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause; - -$query = new LocationQuery(); -$query->sortClauses = [new SortClause\SectionName()]; -``` diff --git a/docs/search/sort_clause_reference/sort_clause_reference.md b/docs/search/sort_clause_reference/sort_clause_reference.md index e5ad8fdf544..f9234c61a47 100644 --- a/docs/search/sort_clause_reference/sort_clause_reference.md +++ b/docs/search/sort_clause_reference/sort_clause_reference.md @@ -6,8 +6,7 @@ month_change: false # Sort Clause reference -Sort Clauses are the sorting options for Content and Location Search and -[Repository filtering](search_api.md#repository-filtering). +Sort Clauses are the sorting options for Content and Location Search. Capabilities of individual Sort Clauses can depend on the search engine. diff --git a/docs/search/sort_clause_reference/userlogin_sort_clause.md b/docs/search/sort_clause_reference/userlogin_sort_clause.md index 09b9d780042..94a69f4d49b 100644 --- a/docs/search/sort_clause_reference/userlogin_sort_clause.md +++ b/docs/search/sort_clause_reference/userlogin_sort_clause.md @@ -9,13 +9,3 @@ The `UserLogin` Sort Clause sorts the results of searching in Trash by the login ## Arguments - (optional) `sortDirection` - Query constant, either `Query::SORT_ASC` or `Query::SORT_DESC` - -## Example - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause; - -$query = new Query(); -$query->sortClauses = [new SortClause\Trash\UserLogin()]; -``` diff --git a/docs/search/sort_clause_reference/visibility_sort_clause.md b/docs/search/sort_clause_reference/visibility_sort_clause.md index a606abb9e44..4a416b0fc3e 100644 --- a/docs/search/sort_clause_reference/visibility_sort_clause.md +++ b/docs/search/sort_clause_reference/visibility_sort_clause.md @@ -11,13 +11,3 @@ Locations that aren't visible are ranked as higher values (for example, with asc ## Arguments [[= include_file('docs/snippets/sort_direction.md') =]] - -## Example - -``` php -use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause; - -$query = new LocationQuery(); -$query->sortClauses = [new SortClause\Location\Visibility()]; -``` diff --git a/docs/search/url_search_reference/id_url_sort_clause.md b/docs/search/url_search_reference/id_url_sort_clause.md index 4fa5319c065..fd202d1227d 100644 --- a/docs/search/url_search_reference/id_url_sort_clause.md +++ b/docs/search/url_search_reference/id_url_sort_clause.md @@ -9,15 +9,3 @@ The `SortClause\Id` Sort Clause sorts search results by the ID of the URL. ## Arguments - `sortDirection` (optional) - the direction of the sorting, either `\Ibexa\Contracts\Core\Repository\Values\URL\Query\SortClause::SORT_ASC` (default) or `\Ibexa\Contracts\Core\Repository\Values\URL\Query\SortClause::SORT_DESC` - -## Example - -``` php -use Ibexa\Contracts\Core\Repository\Values\URL\Query\SortClause; -use Ibexa\Contracts\Core\Repository\Values\URL\URLQuery; - -// ... - -$query = new URLQuery(); -$query->sortClauses = [new SortClause\Id()]; -``` diff --git a/docs/search/url_search_reference/logicaland_url_criterion.md b/docs/search/url_search_reference/logicaland_url_criterion.md index cfedb4f2e3f..3447f5089af 100644 --- a/docs/search/url_search_reference/logicaland_url_criterion.md +++ b/docs/search/url_search_reference/logicaland_url_criterion.md @@ -9,18 +9,3 @@ The `LogicalAnd` URL Criterion matches a URL if all provided Criteria match. ## Arguments - `criterion` - the set of Criteria combined by the logical operator - -## Example - -``` php -use Ibexa\Contracts\Core\Repository\Values\URL\Query\Criterion; -use Ibexa\Contracts\Core\Repository\Values\URL\URLQuery; - -$query = new URLQuery(); -$query->filter = new Criterion\LogicalAnd( - [ - new Criterion\Validity(true), - new Criterion\Pattern('ibexa.co'), - ] -); -``` diff --git a/docs/search/url_search_reference/logicalnot_url_criterion.md b/docs/search/url_search_reference/logicalnot_url_criterion.md index 69e30ad2b9e..89b971e1034 100644 --- a/docs/search/url_search_reference/logicalnot_url_criterion.md +++ b/docs/search/url_search_reference/logicalnot_url_criterion.md @@ -11,15 +11,3 @@ It takes only one Criterion in the array parameter. ## Arguments - `criterion` - represents the Criterion that should be negated - -## Example - -``` php -use Ibexa\Contracts\Core\Repository\Values\URL\Query\Criterion; -use Ibexa\Contracts\Core\Repository\Values\URL\URLQuery; - -$query = new URLQuery(); -$query->filter = new Criterion\LogicalNot( - new Criterion\Pattern('ibexa.co') -); -``` diff --git a/docs/search/url_search_reference/logicalor_url_criterion.md b/docs/search/url_search_reference/logicalor_url_criterion.md index 036da239649..c823dce9fff 100644 --- a/docs/search/url_search_reference/logicalor_url_criterion.md +++ b/docs/search/url_search_reference/logicalor_url_criterion.md @@ -9,18 +9,3 @@ The `LogicalOr` URL Criterion matches a URL if at least one of the provided Crit ## Arguments - `criterion` - the set of Criteria combined by the logical operator - -## Example - -``` php -use Ibexa\Contracts\Core\Repository\Values\URL\Query\Criterion; -use Ibexa\Contracts\Core\Repository\Values\URL\URLQuery; - -$query = new URLQuery(); -$query->filter = new Criterion\LogicalOr( - [ - new Criterion\SectionIdentifier(['sports', 'news']), - new Criterion\Pattern('ibexa.co'), - ] -); -``` diff --git a/docs/search/url_search_reference/pattern_url_criterion.md b/docs/search/url_search_reference/pattern_url_criterion.md index 60973c2231e..610f3f2e202 100644 --- a/docs/search/url_search_reference/pattern_url_criterion.md +++ b/docs/search/url_search_reference/pattern_url_criterion.md @@ -9,13 +9,3 @@ The `Pattern` URL Criterion matches URLs that contain the provided pattern. ## Arguments - `pattern` - string representing the pattern that needs to be a part of the URL - -## Example - -``` php -use Ibexa\Contracts\Core\Repository\Values\URL\Query\Criterion; -use Ibexa\Contracts\Core\Repository\Values\URL\URLQuery; - -$query = new URLQuery(); -$query->filter = new Criterion\Pattern('ibexa.co'); -``` diff --git a/docs/search/url_search_reference/sectionid_url_criterion.md b/docs/search/url_search_reference/sectionid_url_criterion.md index 9a2e0630ddb..7bbce390b8f 100644 --- a/docs/search/url_search_reference/sectionid_url_criterion.md +++ b/docs/search/url_search_reference/sectionid_url_criterion.md @@ -9,13 +9,3 @@ The `SectionId` URL Criterion matches URLs based on the ID of the related conten ## Arguments - `sectionIds` - array of ints representing the IDs of the related content Sections - -## Example - -``` php -use Ibexa\Contracts\Core\Repository\Values\URL\Query\Criterion; -use Ibexa\Contracts\Core\Repository\Values\URL\URLQuery; - -$query = new URLQuery(); -$query->filter = new Criterion\SectionId([1, 3]); -``` diff --git a/docs/search/url_search_reference/sectionidentifier_url_criterion.md b/docs/search/url_search_reference/sectionidentifier_url_criterion.md index 14543fcdf62..22433978743 100644 --- a/docs/search/url_search_reference/sectionidentifier_url_criterion.md +++ b/docs/search/url_search_reference/sectionidentifier_url_criterion.md @@ -9,13 +9,3 @@ The SectionIdentifier URL Criterion matches URLs related to the content placed i ## Arguments - `sectionIdentifiers` - string(s) representing the identifiers of the Section(s) - -## Example - -``` php -use Ibexa\Contracts\Core\Repository\Values\URL\Query\Criterion; -use Ibexa\Contracts\Core\Repository\Values\URL\URLQuery; - -$query = new URLQuery(); -$query->filter = new Criterion\SectionIdentifier(['standard', 'media']); -``` diff --git a/docs/search/url_search_reference/url_url_sort_clause.md b/docs/search/url_search_reference/url_url_sort_clause.md index 74f63eb3a55..5e20db28baa 100644 --- a/docs/search/url_search_reference/url_url_sort_clause.md +++ b/docs/search/url_search_reference/url_url_sort_clause.md @@ -9,15 +9,3 @@ The `SortClause\Url` Sort Clause sorts search results by the URLs. ## Arguments - `sortDirection` - the direction of the sorting, either `\Ibexa\Contracts\Core\Repository\Values\URL\Query\SortClause::SORT_ASC` (default) or `\Ibexa\Contracts\Core\Repository\Values\URL\Query\SortClause::SORT_DESC` - -## Example - -``` php -use Ibexa\Contracts\Core\Repository\Values\URL\Query\SortClause; -use Ibexa\Contracts\Core\Repository\Values\URL\URLQuery; - -// ... - -$query = new URLQuery(); -$query->sortClauses = [new SortClause\URL()]; -``` diff --git a/docs/search/url_search_reference/validity_url_criterion.md b/docs/search/url_search_reference/validity_url_criterion.md index 72d869005c0..4bba5163b65 100644 --- a/docs/search/url_search_reference/validity_url_criterion.md +++ b/docs/search/url_search_reference/validity_url_criterion.md @@ -9,13 +9,3 @@ The Validity URL Criterion matches URLs based on a validity flag. ## Arguments - `isValid` - bool representing whether the matcher selects only valid URLs - -## Example - -``` php -use Ibexa\Contracts\Core\Repository\Values\URL\Query\Criterion; -use Ibexa\Contracts\Core\Repository\Values\URL\URLQuery; - -$query = new URLQuery(); -$query->filter = new Criterion\Validity(true); -``` diff --git a/mkdocs.yml b/mkdocs.yml index d7f3f5b201d..613e0dc37a6 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -260,7 +260,6 @@ nav: - Customize Raptor CDP data: raptor_cdp/raptor_cdp_data_customization.md - Search: - Search: search/search.md - - Search API: search/search_api.md - Search Criteria and Sort Clauses: search/search_criteria_and_sort_clauses.md - Search Criteria reference: - Search Criteria reference: search/criteria_reference/search_criteria_reference.md diff --git a/tests/python/invariants-baseline.yaml b/tests/python/invariants-baseline.yaml index b85024e09e3..f420c9b346d 100644 --- a/tests/python/invariants-baseline.yaml +++ b/tests/python/invariants-baseline.yaml @@ -141,183 +141,6 @@ php_code_sample: - product_catalog/quable/quable_api.md - raptor_cdp/raptor_cdp_data_customization.md - recommendations/raptor_integration/tracking_php_api.md - - search/activity_log_search_reference/action_criterion.md - - search/activity_log_search_reference/logged_at_criterion.md - - search/activity_log_search_reference/object_criterion.md - - search/activity_log_search_reference/object_name_criterion.md - - search/activity_log_search_reference/user_criterion.md - - search/aggregation_reference/authorterm_aggregation.md - - search/aggregation_reference/basepricestats_aggregation.md - - search/aggregation_reference/checkboxterm_aggregation.md - - search/aggregation_reference/contenttypegroupterm_aggregation.md - - search/aggregation_reference/contenttypeterm_aggregation.md - - search/aggregation_reference/countryterm_aggregation.md - - search/aggregation_reference/custompricestats_aggregation.md - - search/aggregation_reference/datemetadatarange_aggregation.md - - search/aggregation_reference/daterange_aggregation.md - - search/aggregation_reference/datetimerange_aggregation.md - - search/aggregation_reference/floatrange_aggregation.md - - search/aggregation_reference/floatstats_aggregation.md - - search/aggregation_reference/integerrange_aggregation.md - - search/aggregation_reference/integerstats_aggregation.md - - search/aggregation_reference/keywordterm_aggregation.md - - search/aggregation_reference/languageterm_aggregation.md - - search/aggregation_reference/locationchildrenterm_aggregation.md - - search/aggregation_reference/objectstateterm_aggregation.md - - search/aggregation_reference/product_attribute_aggregations.md - - search/aggregation_reference/productavailabilityterm_aggregation.md - - search/aggregation_reference/productpricerange_aggregation.md - - search/aggregation_reference/productstockrange_aggregation.md - - search/aggregation_reference/producttypeterm_aggregation.md - - search/aggregation_reference/rawrange_aggregation.md - - search/aggregation_reference/rawstats_aggregation.md - - search/aggregation_reference/rawterm_aggregation.md - - search/aggregation_reference/sectionterm_aggregation.md - - search/aggregation_reference/selectionterm_aggregation.md - - search/aggregation_reference/subtreeterm_aggregation.md - - search/aggregation_reference/taxonomyentryid_aggregation.md - - search/aggregation_reference/timerange_aggregation.md - - search/aggregation_reference/usermetadataterm_aggregation.md - - search/aggregation_reference/visibilityterm_aggregation.md - - search/ai_actions_search_reference/action_configuration_criteria.md - - search/ai_actions_search_reference/action_configuration_sort_clauses.md - - search/content_type_search_reference/content_type_criteria.md - - search/content_type_search_reference/content_type_sort_clauses.md - - search/criteria_reference/ancestor_criterion.md - - search/criteria_reference/baseprice_criterion.md - - search/criteria_reference/checkboxattribute_criterion.md - - search/criteria_reference/colorattribute_criterion.md - - search/criteria_reference/contentid_criterion.md - - search/criteria_reference/contentname_criterion.md - - search/criteria_reference/contenttypegroupid_criterion.md - - search/criteria_reference/contenttypeid_criterion.md - - search/criteria_reference/contenttypeidentifier_criterion.md - - search/criteria_reference/createdat_criterion.md - - search/criteria_reference/createdatrange_criterion.md - - search/criteria_reference/currencycode_criterion.md - - search/criteria_reference/customergroupid_criterion.md - - search/criteria_reference/customfield_criterion.md - - search/criteria_reference/customprice_criterion.md - - search/criteria_reference/datemetadata_criterion.md - - search/criteria_reference/datetimeattribute_criterion.md - - search/criteria_reference/datetimeattributerange_criterion.md - - search/criteria_reference/depth_criterion.md - - search/criteria_reference/field_criterion.md - - search/criteria_reference/fieldrelation_criterion.md - - search/criteria_reference/floatattribute_criterion.md - - search/criteria_reference/fulltext_criterion.md - - search/criteria_reference/image_criterion.md - - search/criteria_reference/imagedimensions_criterion.md - - search/criteria_reference/imagefilesize_criterion.md - - search/criteria_reference/imageheight_criterion.md - - search/criteria_reference/imagemimetype_criterion.md - - search/criteria_reference/imageorientation_criterion.md - - search/criteria_reference/imagewidth_criterion.md - - search/criteria_reference/integerattribute_criterion.md - - search/criteria_reference/isbookmarked_criterion.md - - search/criteria_reference/iscontainer_criterion.md - - search/criteria_reference/iscurrencyenabled_criterion.md - - search/criteria_reference/isfieldempty_criterion.md - - search/criteria_reference/ismainlocation_criterion.md - - search/criteria_reference/isproductbased_criterion.md - - search/criteria_reference/isuserbased_criterion.md - - search/criteria_reference/isuserenabled_criterion.md - - search/criteria_reference/isvirtual_criterion.md - - search/criteria_reference/languagecode_criterion.md - - search/criteria_reference/locationid_criterion.md - - search/criteria_reference/locationremoteid_criterion.md - - search/criteria_reference/logicaland_criterion.md - - search/criteria_reference/logicalnot_criterion.md - - search/criteria_reference/logicalor_criterion.md - - search/criteria_reference/maplocationdistance_criterion.md - - search/criteria_reference/notification_datecreated_criterion.md - - search/criteria_reference/notification_status_criterion.md - - search/criteria_reference/notification_type_criterion.md - - search/criteria_reference/objectstateid_criterion.md - - search/criteria_reference/objectstateidentifier_criterion.md - - search/criteria_reference/parentlocationid_criterion.md - - search/criteria_reference/price_currency_criterion.md - - search/criteria_reference/price_customergroup_criterion.md - - search/criteria_reference/price_isbaseprice_criterion.md - - search/criteria_reference/price_iscustomprice_criterion.md - - search/criteria_reference/price_logicaland_criterion.md - - search/criteria_reference/price_logicalor_criterion.md - - search/criteria_reference/price_product_criterion.md - - search/criteria_reference/priority_criterion.md - - search/criteria_reference/productavailability_criterion.md - - search/criteria_reference/productcategory_criterion.md - - search/criteria_reference/productcategorysubtree_criterion.md - - search/criteria_reference/productcode_criterion.md - - search/criteria_reference/productname_criterion.md - - search/criteria_reference/productstock_criterion.md - - search/criteria_reference/productstockrange_criterion.md - - search/criteria_reference/producttype_criterion.md - - search/criteria_reference/rangemeasurementattributemaximum_criterion.md - - search/criteria_reference/rangemeasurementattributeminimum_criterion.md - - search/criteria_reference/remoteid_criterion.md - - search/criteria_reference/sectionid_criterion.md - - search/criteria_reference/sectionidentifier_criterion.md - - search/criteria_reference/selectionattribute_criterion.md - - search/criteria_reference/sibling_criterion.md - - search/criteria_reference/simplemeasurementattribute_criterion.md - - search/criteria_reference/subtree_criterion.md - - search/criteria_reference/symbolattribute_criterion.md - - search/criteria_reference/taxonomy_entry_id.md - - search/criteria_reference/taxonomy_no_entries.md - - search/criteria_reference/taxonomy_subtree.md - - search/criteria_reference/updated_at_criterion.md - - search/criteria_reference/updated_at_range_criterion.md - - search/criteria_reference/useremail_criterion.md - - search/criteria_reference/userid_criterion.md - - search/criteria_reference/userlogin_criterion.md - - search/criteria_reference/usermetadata_criterion.md - - search/criteria_reference/visibility_criterion.md - - search/embeddings_reference/embeddings_reference.md - - search/extensibility/create_custom_aggregation.md - - search/extensibility/create_custom_search_criterion.md - - search/extensibility/create_custom_sort_clause.md - - search/extensibility/customize_elasticsearch_index_structure.md - - search/extensibility/index_custom_elasticsearch_data.md - - search/extensibility/manipulate_elasticsearch_query.md - - search/extensibility/solr_document_field_mappers.md - - search/search_api.md - - search/search_engines/solr_search_engine/configure_solr.md - - search/sort_clause_reference/baseprice_sort_clause.md - - search/sort_clause_reference/contentid_sort_clause.md - - search/sort_clause_reference/contentname_sort_clause.md - - search/sort_clause_reference/contenttranslatedname_sort_clause.md - - search/sort_clause_reference/contenttypename_sort_clause.md - - search/sort_clause_reference/createdat_sort_clause.md - - search/sort_clause_reference/customfield_sort_clause.md - - search/sort_clause_reference/customprice_sort_clause.md - - search/sort_clause_reference/datemodified_sort_clause.md - - search/sort_clause_reference/datepublished_sort_clause.md - - search/sort_clause_reference/datetrashed_sort_clause.md - - search/sort_clause_reference/depth_sort_clause.md - - search/sort_clause_reference/field_sort_clause.md - - search/sort_clause_reference/id_sort_clause.md - - search/sort_clause_reference/ismainlocation_sort_clause.md - - search/sort_clause_reference/maplocationdistance_sort_clause.md - - search/sort_clause_reference/path_sort_clause.md - - search/sort_clause_reference/priority_sort_clause.md - - search/sort_clause_reference/productavailability_sort_clause.md - - search/sort_clause_reference/productcode_sort_clause.md - - search/sort_clause_reference/productname_sort_clause.md - - search/sort_clause_reference/random_sort_clause.md - - search/sort_clause_reference/score_sort_clause.md - - search/sort_clause_reference/sectionidentifier_sort_clause.md - - search/sort_clause_reference/sectionname_sort_clause.md - - search/sort_clause_reference/userlogin_sort_clause.md - - search/sort_clause_reference/visibility_sort_clause.md - - search/url_search_reference/id_url_sort_clause.md - - search/url_search_reference/logicaland_url_criterion.md - - search/url_search_reference/logicalnot_url_criterion.md - - search/url_search_reference/logicalor_url_criterion.md - - search/url_search_reference/pattern_url_criterion.md - - search/url_search_reference/sectionid_url_criterion.md - - search/url_search_reference/sectionidentifier_url_criterion.md - - search/url_search_reference/url_url_sort_clause.md - - search/url_search_reference/validity_url_criterion.md - snippets/search_term_aggregation_settings.md - templating/components.md - templating/embed_and_list_content/embed_content.md