Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance search doc #2540

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
98 changes: 49 additions & 49 deletions docs/search/criteria_reference/search_criteria_reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,55 +21,55 @@

## 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|✔|✔||
|[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 | | ✔ | ✔ | |

Check warning on line 34 in docs/search/criteria_reference/search_criteria_reference.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/search/criteria_reference/search_criteria_reference.md#L34

[Ibexa.DontCapitalize] Don't capitalize 'Content tree' if inside the sentence.
Raw output
{"message": "[Ibexa.DontCapitalize] Don't capitalize 'Content tree' if inside the sentence.", "location": {"path": "docs/search/criteria_reference/search_criteria_reference.md", "range": {"start": {"line": 34, "column": 89}}}, "severity": "WARNING"}
| [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 | ✔ | ✔ | | |
| [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

Expand Down
2 changes: 0 additions & 2 deletions docs/search/search_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,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.
Expand Down
5 changes: 3 additions & 2 deletions docs/search/search_in_trash_reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@

# 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`.
adriendupuis marked this conversation as resolved.
Show resolved Hide resolved
Some sort clauses are exclusive to trash search.

Check failure on line 10 in docs/search/search_in_trash_reference.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/search/search_in_trash_reference.md#L10

[Ibexa.DomainTermCapitalization] Use 'Sort Clause(s)' instead of 'sort clauses'
Raw output
{"message": "[Ibexa.DomainTermCapitalization] Use 'Sort Clause(s)' instead of 'sort clauses'", "location": {"path": "docs/search/search_in_trash_reference.md", "range": {"start": {"line": 10, "column": 6}}}, "severity": "ERROR"}

## Search Criteria

Expand Down
Loading
Loading