diff --git a/code_samples/api/public_php_api/src/Command/FilterLocationCommand.php b/code_samples/api/public_php_api/src/Command/FilterLocationCommand.php index cb280895f1..dc17b915e3 100644 --- a/code_samples/api/public_php_api/src/Command/FilterLocationCommand.php +++ b/code_samples/api/public_php_api/src/Command/FilterLocationCommand.php @@ -41,7 +41,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $result = $this->locationService->find($filter, []); - $output->writeln('Found ' . $result->totalCount . ' items'); + $output->writeln('Found ' . $result->getTotalCount() . ' items'); foreach ($result as $content) { $output->writeln($content->getContent()->getName()); diff --git a/docs/search/criteria_reference/search_criteria_reference.md b/docs/search/criteria_reference/search_criteria_reference.md index 344c0742ee..4fc927923f 100644 --- a/docs/search/criteria_reference/search_criteria_reference.md +++ b/docs/search/criteria_reference/search_criteria_reference.md @@ -20,64 +20,64 @@ Due to this storage limitation, searching content using the Country field type o ## Search Criteria -|Search Criterion|Search based on|Content Search |Location Search |Filtering | -|-----|-----|-----|-----|-----| -|[Ancestor](ancestor_criterion.md)|Whether the content item is an ancestor of the provided location|✔ |✔ |✔ | -|[ContentId](contentid_criterion.md)|Content item's ID|✔ |✔ |✔ | -|[ContentName](contentname_criterion.md)|Content item's name|✔ |✔ |✔ | -|[ContentTypeGroupId](contenttypegroupid_criterion.md)|ID of the content item's content type group|✔ |✔ |✔ | -|[ContentTypeId](contenttypeid_criterion.md)|ID of the content item's content type|✔ |✔ |✔ | -|[ContentTypeIdentifier](contenttypeidentifier_criterion.md)|Identifier of the content item's content type|✔ |✔ |✔ | -|[CurrencyCodeCriterion](currencycode_criterion.md)|Currency code|✔ |✔ |✔ | -|[DateMetadata](datemetadata_criterion.md)|The date when content was created or last modified|✔ |✔ |✔ | -|[Depth](depth_criterion.md)|Location depth in the content tree| |✔ |✔ | -|[Field](field_criterion.md)|Content of one of content item's fields|✔ |✔ | | -|[FieldRelation](fieldrelation_criterion.md)|Content items the content in question has Relations to|✔ |✔ | | -|[FullText](fulltext_criterion.md)|Full text content of a content item's fields|✔ |✔ | | -|[Image](image_criterion.md)|Image by specified image attributes|✔|✔|| -|[ImageDimensions](imagedimensions_criterion.md)|Image dimensions: height and width|✔|✔|| -|[ImageFileSize](imagefilesize_criterion.md)|Image size in MB|✔|✔|| -|[ImageHeight](imageheight_criterion.md)|Image height in pixels|✔|✔|| -|[ImageMimeType](imagemimetype_criterion.md)|Image type|✔|✔|| -|[ImageOrientation](imageorientation_criterion.md)|Image orientation|✔|✔|| -|[ImageWidth](imagewidth_criterion.md)|Image width in pixels|✔|✔|| -|[IsBookmarked](isbookmarked_criterion.md)|Whether a location is bookmarked or not| |✔ |✔ | -|[IsCurrencyEnabledCriterion](iscurrencyenabled_criterion.md)|Whether a specified currency is enabled in the system| | | | -|[IsFieldEmpty](isfieldempty_criterion.md)|Whether a specified field of a content item is empty or not|✔ |✔ | | -|[IsMainLocation](ismainlocation_criterion.md)|Whether a location is the main location of a content item| |✔ |✔ | -|[IsProductBased](isproductbased_criterion.md)|Whether content represents a product|✔ |✔ |✔ | -|[IsUserBased](isuserbased_criterion.md)|Whether content represents a User account|✔ |✔ |✔ | -|[IsUserEnabled](isuserenabled_criterion.md)|Whether a User account is enabled|✔ |✔ |✔ | -|[LanguageCode](languagecode_criterion.md)|Whether a content item is translated into the selected language|✔ |✔ |✔ | -|[LocationId](locationid_criterion.md)|Location ID|✔ |✔ |✔ | -|[LocationRemoteId](locationremoteid_criterion.md)|Location remote ID|✔ |✔ |✔ | -|[MapLocationDistance](maplocationdistance_criterion.md)|Distance between the location contained in a MapLocation field and the provided coordinates|✔ |✔ | | -|[MatchAll](matchall_criterion.md)|Returns all search results|✔ |✔ |✔ | -|[MatchNone](matchnone_criterion.md)|Returns no search results|✔ |✔ |✔ | -|[ObjectStateId](objectstateid_criterion.md)|Object state ID|✔ |✔ |✔ | -|[ObjectStateIdentifier](objectstateidentifier_criterion.md)|Object state Identifier|✔ |✔ |✔ | -|[ParentLocationId](parentlocationid_criterion.md)|Location ID of a content item's parent|✔ |✔ |✔ | -|[ParentLocationRemoteId](parentlocationremoteId_criterion.md)|Location remote ID of a content item's parent|✔ |✔ | -|[Priority](priority_criterion.md)|Location priority| |✔ |✔ | -|[RemoteId](remoteid_criterion.md)|Remote content ID|✔ |✔ |✔ | -|[SectionId](sectionid_criterion.md)|ID of the Section content is assigned to|✔ |✔ |✔ | -|[SectionIdentifier](sectionidentifier_criterion.md)|Identifier of the Section content is assigned to|✔ |✔ |✔ | -|[Sibling](sibling_criterion.md)|Locations that are children of the same parent|✔ |✔ |✔ | -|[Subtree](subtree_criterion.md)|Location subtree|✔ |✔ |✔ | -|[TaxonomyEntryId](taxonomy_entry_id.md)|Content tagged with Entry ID|✔ |✔ |✔ | -|[UserEmail](useremail_criterion.md)|Email address of a User account|✔ |✔ |✔ | -|[UserId](userid_criterion.md)|User ID|✔ |✔ |✔ | -|[UserLogin](userlogin_criterion.md)|User login|✔ |✔ |✔ | -|[UserMetadata](usermetadata_criterion.md)|The creator or modifier of a content item|✔ |✔ |✔ | -|[Visibility](visibility_criterion.md)|Whether the content item is visible or not|✔ |✔ |✔ | +| Search Criterion | Search based on | Content Search | Location Search | Filtering | Trash | +|---------------------------------------------------------------|---------------------------------------------------------------------------------------------|----------------|-----------------|-----------|----------| +| [Ancestor](ancestor_criterion.md) | Whether the content item is an ancestor of the provided location | ✔ | ✔ | ✔ | | +| [ContentId](contentid_criterion.md) | Content item's ID | ✔ | ✔ | ✔ | | +| [ContentName](contentname_criterion.md) | Content item's name | ✔ | ✔ | ✔ | ✔ | +| [ContentTypeGroupId](contenttypegroupid_criterion.md) | ID of the content item's content type group | ✔ | ✔ | ✔ | | +| [ContentTypeId](contenttypeid_criterion.md) | ID of the content item's content type | ✔ | ✔ | ✔ | ✔ | +| [ContentTypeIdentifier](contenttypeidentifier_criterion.md) | Identifier of the content item's content type | ✔ | ✔ | ✔ | | +| [CurrencyCodeCriterion](currencycode_criterion.md) | Currency code | ✔ | ✔ | ✔ | | +| [DateMetadata](datemetadata_criterion.md) | The date when content was created or last modified | ✔ | ✔ | ✔ | ✔ | +| [Depth](depth_criterion.md) | Location depth in the content tree | | ✔ | ✔ | | +| [Field](field_criterion.md) | Content of one of content item's fields | ✔ | ✔ | | | +| [FieldRelation](fieldrelation_criterion.md) | Content items the content in question has Relations to | ✔ | ✔ | | | +| [FullText](fulltext_criterion.md) | Full text content of a content item's fields | ✔ | ✔ | | | +| [Image](image_criterion.md) | Image by specified image attributes | ✔ | ✔ | | | +| [ImageDimensions](imagedimensions_criterion.md) | Image dimensions: height and width | ✔ | ✔ | | | +| [ImageFileSize](imagefilesize_criterion.md) | Image size in MB | ✔ | ✔ | | | +| [ImageHeight](imageheight_criterion.md) | Image height in pixels | ✔ | ✔ | | | +| [ImageMimeType](imagemimetype_criterion.md) | Image type | ✔ | ✔ | | | +| [ImageOrientation](imageorientation_criterion.md) | Image orientation | ✔ | ✔ | | | +| [ImageWidth](imagewidth_criterion.md) | Image width in pixels | ✔ | ✔ | | | +| [IsBookmarked](isbookmarked_criterion.md) | Whether a location is bookmarked or not | | ✔ | ✔ | | +| [IsCurrencyEnabledCriterion](iscurrencyenabled_criterion.md) | Whether a specified currency is enabled in the system | | | | | +| [IsFieldEmpty](isfieldempty_criterion.md) | Whether a specified field of a content item is empty or not | ✔ | ✔ | | | +| [IsMainLocation](ismainlocation_criterion.md) | Whether a location is the main location of a content item | | ✔ | ✔ | | +| [IsProductBased](isproductbased_criterion.md) | Whether content represents a product | ✔ | ✔ | ✔ | | +| [IsUserBased](isuserbased_criterion.md) | Whether content represents a User account | ✔ | ✔ | ✔ | | +| [IsUserEnabled](isuserenabled_criterion.md) | Whether a User account is enabled | ✔ | ✔ | ✔ | | +| [LanguageCode](languagecode_criterion.md) | Whether a content item is translated into the selected language | ✔ | ✔ | ✔ | | +| [LocationId](locationid_criterion.md) | Location ID | ✔ | ✔ | ✔ | | +| [LocationRemoteId](locationremoteid_criterion.md) | Location remote ID | ✔ | ✔ | ✔ | | +| [MapLocationDistance](maplocationdistance_criterion.md) | Distance between the location contained in a MapLocation field and the provided coordinates | ✔ | ✔ | | | +| [MatchAll](matchall_criterion.md) | Returns all search results | ✔ | ✔ | ✔ | ✔ | +| [MatchNone](matchnone_criterion.md) | Returns no search results | ✔ | ✔ | ✔ | ✔ | +| [ObjectStateId](objectstateid_criterion.md) | Object state ID | ✔ | ✔ | ✔ | | +| [ObjectStateIdentifier](objectstateidentifier_criterion.md) | Object state Identifier | ✔ | ✔ | ✔ | | +| [ParentLocationId](parentlocationid_criterion.md) | Location ID of a content item's parent | ✔ | ✔ | ✔ | | +| [ParentLocationRemoteId](parentlocationremoteId_criterion.md) | Location remote ID of a content item's parent | ✔ | ✔ | | +| [Priority](priority_criterion.md) | Location priority | | ✔ | ✔ | | +| [RemoteId](remoteid_criterion.md) | Remote content ID | ✔ | ✔ | ✔ | | +| [SectionId](sectionid_criterion.md) | ID of the Section content is assigned to | ✔ | ✔ | ✔ | ✔ | +| [SectionIdentifier](sectionidentifier_criterion.md) | Identifier of the Section content is assigned to | ✔ | ✔ | ✔ | | +| [Sibling](sibling_criterion.md) | Locations that are children of the same parent | ✔ | ✔ | ✔ | | +| [Subtree](subtree_criterion.md) | Location subtree | ✔ | ✔ | ✔ | | +| [TaxonomyEntryId](taxonomy_entry_id.md) | Content tagged with Entry ID | ✔ | ✔ | ✔ | | +| [UserEmail](useremail_criterion.md) | Email address of a User account | ✔ | ✔ | ✔ | | +| [UserId](userid_criterion.md) | User ID | ✔ | ✔ | ✔ | | +| [UserLogin](userlogin_criterion.md) | User login | ✔ | ✔ | ✔ | | +| [UserMetadata](usermetadata_criterion.md) | The creator or modifier of a content item | ✔ | ✔ | ✔ | ✔ | +| [Visibility](visibility_criterion.md) | Whether the content item is visible or not | ✔ | ✔ | ✔ | | ### Logical operators All Logical operators are supported by Content and Location Search and [Repository filtering](search_api.md#repository-filtering). -|Search Criterion|Search based on| -|-----|-----| -|[LogicalAnd](logicaland_criterion.md)|Implements a logical AND Criterion. It matches if ALL of the provided Criteria match.| -|[LogicalNot](logicalnot_criterion.md)|Implements a logical NOT Criterion. It matches if the provided Criterion doesn't match.| -|[LogicalOr](logicalor_criterion.md)|Implements a logical OR Criterion. It matches if at least one of the provided Criteria matches.| +| Search Criterion | Search based on | +|---------------------------------------|-------------------------------------------------------------------------------------------------| +| [LogicalAnd](logicaland_criterion.md) | Implements a logical AND Criterion. It matches if ALL of the provided Criteria match. | +| [LogicalNot](logicalnot_criterion.md) | Implements a logical NOT Criterion. It matches if the provided Criterion doesn't match. | +| [LogicalOr](logicalor_criterion.md) | Implements a logical OR Criterion. It matches if at least one of the provided Criteria matches. | diff --git a/docs/search/search_api.md b/docs/search/search_api.md index ab8f8d183a..486a99eb40 100644 --- a/docs/search/search_api.md +++ b/docs/search/search_api.md @@ -131,8 +131,6 @@ The same Filter can be applied to find locations instead of content items, for e [[= include_file('code_samples/api/public_php_api/src/Command/FilterLocationCommand.php', 32, 52) =]] ``` -Notice that the total number of items is retrieved differently for `ContentList` and `LocationList`. - !!! caution The total count is the total number of matched items, regardless of pagination settings. diff --git a/docs/search/search_in_trash_reference.md b/docs/search/search_in_trash_reference.md index a41eecd9e7..d8ae83e295 100644 --- a/docs/search/search_in_trash_reference.md +++ b/docs/search/search_in_trash_reference.md @@ -5,13 +5,15 @@ page_type: reference # Search in trash reference -When you [search for content items that are held in trash](search_api.md#searching-in-trash), you can apply only a limited set of Search Criteria and Sort Clauses. -They can be used by `Ibexa\Contracts\Core\Repository\TrashService::findTrashItems` only. +When you [search for content items that are held in trash](search_api.md#searching-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`](../api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-TrashService.html#method_findTrashItems). +Some sort clauses are exclusive to trash search. ## Search Criteria +- [ContentName](contentname_criterion.md) - [ContentTypeId](contenttypeid_criterion.md) -- [DateMetadata](datemetadata_criterion.md) +- [DateMetadata](datemetadata_criterion.md) (which can use the additional exclusive target `DateMetadata::TRASHED`) - [MatchAll](matchall_criterion.md) - [MatchNone](matchnone_criterion.md) - [SectionId](sectionid_criterion.md) diff --git a/docs/search/sort_clause_reference/sort_clause_reference.md b/docs/search/sort_clause_reference/sort_clause_reference.md index b2851a0604..e3bc02e0ce 100644 --- a/docs/search/sort_clause_reference/sort_clause_reference.md +++ b/docs/search/sort_clause_reference/sort_clause_reference.md @@ -16,23 +16,26 @@ All Sort Clauses can take the following optional argument: ## Sort Clauses -| Sort Clause | Sorting based on | Content Search | Location Search | Filtering | -|---------------------------------------------------------------|---------------------------------------------------------------------------------------------|----------------|-----------------|-----------| -| [ContentId](contentid_sort_clause.md) | Content items' ID | ✔ | ✔ | ✔ | -| [ContentName](contentname_sort_clause.md) | Content names | ✔ | ✔ | ✔ | -| [ContentTranslatedName](contenttranslatedname_sort_clause.md) | Translated content names | ✔ | ✔ | | -| [CustomField](customfield_sort_clause.md) | Raw search index fields | ✔ | ✔ | | -| [DateModified](datemodified_sort_clause.md) | The date when content was last modified | ✔ | ✔ | ✔ | -| [DatePublished](datepublished_sort_clause.md) | The date when content was created | ✔ | ✔ | ✔ | -| [Depth](depth_sort_clause.md) | Location depth in the content tree | | ✔ | ✔ | -| [Field](field_sort_clause.md) | Content of one of content item's fields | ✔ | ✔ | | -| [Id](id_sort_clause.md) | Location ID | | ✔ | ✔ | -| [IsMainLocation](ismainlocation_sort_clause.md) | Whether a location is the main location of a content item | | ✔ | | -| [MapLocationDistance](maplocationdistance_sort_clause.md) | Distance between the location contained in a MapLocation field and the provided coordinates | ✔ | ✔ | | -| [Path](path_sort_clause.md) | PathString of the Location | | ✔ | ✔ | -| [Priority](priority_sort_clause.md) | Location priority | | ✔ | ✔ | -| [Random](random_sort_clause.md) | Random seed | ✔ | ✔ | | -| [Score](score_sort_clause.md) | Score of the search result | ✔ | ✔ | | -| [SectionIdentifier](sectionidentifier_sort_clause.md) | ID of the Section content is assigned to | ✔ | ✔ | ✔ | -| [SectionName](sectionname_sort_clause.md) | Name of the Section content is assigned to | ✔ | ✔ | ✔ | -| [Visibility](visibility_sort_clause.md) | Whether the location is visible or not | | ✔ | ✔ | +| Sort Clause | Sorting based on | Content Search | Location Search | Filtering | Trash | +|---------------------------------------------------------------|--------------------------------------------------------------------------------------------|----------------|-----------------|-----------|----------| +| [ContentId](contentid_sort_clause.md) | Content items' ID | ✔ | ✔ | ✔ | | +| [ContentName](contentname_sort_clause.md) | Content names | ✔ | ✔ | ✔ | ✔ | +| [ContentTranslatedName](contenttranslatedname_sort_clause.md) | Translated content names | ✔ | ✔ | | | +| [ContentTypeName](contenttypename_sort_clause.md) | Content items' content type name | | | | ✔ | +| [CustomField](customfield_sort_clause.md) | Raw search index fields | ✔ | ✔ | | | +| [DateModified](datemodified_sort_clause.md) | The date when content was last modified | ✔ | ✔ | ✔ | | +| [DatePublished](datepublished_sort_clause.md) | The date when content was created | ✔ | ✔ | ✔ | | +| [DateTrashed](datetrashed_sort_clause.md) | The date when content was sent to trash | | | | ✔ | +| [Depth](depth_sort_clause.md) | Location depth in the content tree | | ✔ | ✔ | ✔ | +| [Field](field_sort_clause.md) | Content of one of content item's fields | ✔ | ✔ | | | +| [Id](id_sort_clause.md) | Location ID | | ✔ | ✔ | | +| [IsMainLocation](ismainlocation_sort_clause.md) | Whether a location is the main location of a content item | | ✔ | | | +| [MapLocationDistance](maplocationdistance_sort_clause.md) | Distance between the location contained in a MapLocation field and the provided coordinates | ✔ | ✔ | | | +| [Path](path_sort_clause.md) | PathString of the Location | | ✔ | ✔ | ✔ | +| [Priority](priority_sort_clause.md) | Location priority | | ✔ | ✔ | ✔ | +| [Random](random_sort_clause.md) | Random seed | ✔ | ✔ | | | +| [Score](score_sort_clause.md) | Score of the search result | ✔ | ✔ | | | +| [SectionIdentifier](sectionidentifier_sort_clause.md) | ID of the Section content is assigned to | ✔ | ✔ | ✔ | | +| [SectionName](sectionname_sort_clause.md) | Name of the Section content is assigned to | ✔ | ✔ | ✔ | ✔ | +| [UserLogin](userlogin_sort_clause.md) | Login of the content item's creator | | | | ✔ | +| [Visibility](visibility_sort_clause.md) | Whether the location is visible or not | | ✔ | ✔ | |