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

IBX-8726: IsBookmarked search criterion added #2545

Merged
merged 5 commits into from
Nov 25, 2024
Merged
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
9 changes: 9 additions & 0 deletions code_samples/search/location/isbookmarked_criterion.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php declare(strict_types=1);

use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery;
use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\Location\IsBookmarked;

$query = new LocationQuery();
$query->filter = new IsBookmarked();
/** @var \Ibexa\Contracts\Core\Repository\SearchService $searchService */
$results = $searchService->findLocations($query);
45 changes: 45 additions & 0 deletions docs/search/criteria_reference/isbookmarked_criterion.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---

Check warning on line 1 in docs/search/criteria_reference/isbookmarked_criterion.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/search/criteria_reference/isbookmarked_criterion.md#L1

[Ibexa.ReadingLevel] The grade level is 10.45. Aim for 8th grade or lower by using shorter sentences and words.
Raw output
{"message": "[Ibexa.ReadingLevel] The grade level is 10.45. Aim for 8th grade or lower by using shorter sentences and words.", "location": {"path": "docs/search/criteria_reference/isbookmarked_criterion.md", "range": {"start": {"line": 1, "column": 1}}}, "severity": "WARNING"}
description: IsBookmarked Search Criterion
---

# IsBookmarked Criterion

The [`IsBookmarked` Search Criterion](../../api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-Values-Content-Query-Criterion-Location-IsBookmarked.html)

Check failure on line 7 in docs/search/criteria_reference/isbookmarked_criterion.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/search/criteria_reference/isbookmarked_criterion.md#L7

[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'
Raw output
{"message": "[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'", "location": {"path": "docs/search/criteria_reference/isbookmarked_criterion.md", "range": {"start": {"line": 7, "column": 83}}}, "severity": "ERROR"}
searches for location based on whether it's bookmarked or not.
julitafalcondusza marked this conversation as resolved.
Show resolved Hide resolved
It works with current user reference.

This Criterion is available only for location Search.

## Arguments

- `value` - bool representing whether to search for bookmarked location (default `true`) or not bookmarked location (`false`)

## Example

### PHP

``` php
[[= include_file('code_samples/search/location/isbookmarked_criterion.php', 2) =]]
```

### REST API

=== "XML"

```xml
<Query>
<Filter>
<IsBookmarkedCriterion>true</IsBookmarkedCriterion>
</Filter>
</Query>
```

=== "JSON"

```json
"Query": {
"Filter": {
"IsBookmarkedCriterion": true
}
}
```
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Due to this storage limitation, searching content using the Country Field Type o
|[ImageMimeType](imagemimetype_criterion.md)|Image type|&#10004;|&#10004;||
|[ImageOrientation](imageorientation_criterion.md)|Image orientation|&#10004;|&#10004;||
|[ImageWidth](imagewidth_criterion.md)|Image width in pixels|&#10004;|&#10004;||
|[IsBookmarked](isbookmarked_criterion.md)|Whether a location is bookmarked or not| |&#10004; |&#10004; |
|[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|&#10004; |&#10004; | |
|[IsMainLocation](ismainlocation_criterion.md)|Whether a Location is the main Location of a content item| |&#10004; |&#10004; |
Expand Down
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,7 @@ nav:
- ImageMimeType: search/criteria_reference/imagemimetype_criterion.md
- ImageOrientation: search/criteria_reference/imageorientation_criterion.md
- ImageWidth: search/criteria_reference/imagewidth_criterion.md
- IsBookmarked: search/criteria_reference/isbookmarked_criterion.md
- IsCurrencyEnabled: search/criteria_reference/iscurrencyenabled_criterion.md
- IsFieldEmpty: search/criteria_reference/isfieldempty_criterion.md
- IsMainLocation: search/criteria_reference/ismainlocation_criterion.md
Expand Down
Loading