You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
enables you to perform search queries using the PHP API.
15
15
16
16
The service should be [injected into the constructor of your command or controller](../api/public_php_api.md#service-container).
@@ -22,7 +22,7 @@ The service should be [injected into the constructor of your command or controll
22
22
23
23
### Performing a search
24
24
25
-
To search through content you need to create a [`LocationQuery`](https://github.com/ezsystems/ezplatform-kernel/blob/v1.0.0/eZ/Publish/API/Repository/Values/Content/LocationQuery.php)
25
+
To search through content you need to create a [`LocationQuery`](https://github.com/ezsystems/ezplatform-kernel/blob/v1.3.0/eZ/Publish/API/Repository/Values/Content/LocationQuery.php)
26
26
and provide your search criteria as a series of Criterion objects.
27
27
28
28
For example, to search for all content of a selected Content Type, use one Criterion,
@@ -36,12 +36,12 @@ The following command takes the Content Type identifier as an argument and lists
retrieves [`ContentInfo`](https://github.com/ezsystems/ezplatform-kernel/blob/v1.0.0/eZ/Publish/API/Repository/Values/Content/ContentInfo.php) objects of the found Content items.
41
-
You can also use [`SearchService::findContent`](https://github.com/ezsystems/ezplatform-kernel/blob/v1.0.0/eZ/Publish/API/Repository/SearchService.php#L124) to get full Content objects, together with their Field information.
retrieves [`ContentInfo`](https://github.com/ezsystems/ezplatform-kernel/blob/v1.3.0/eZ/Publish/API/Repository/Values/Content/ContentInfo.php) objects of the found Content items.
41
+
You can also use [`SearchService::findContent`](https://github.com/ezsystems/ezplatform-kernel/blob/v1.3.0/eZ/Publish/API/Repository/SearchService.php#L124) to get full Content objects, together with their Field information.
42
42
43
43
To query for a single result, for example by providing a Content ID,
44
-
use the [`SearchService::findSingle`](https://github.com/ezsystems/ezplatform-kernel/blob/v1.0.0/eZ/Publish/API/Repository/SearchService.php#L161) method:
44
+
use the [`SearchService::findSingle`](https://github.com/ezsystems/ezplatform-kernel/blob/v1.3.0/eZ/Publish/API/Repository/SearchService.php#L161) method:
45
45
46
46
```php
47
47
$criterion = new Criterion\ContentId($contentId);
@@ -107,12 +107,12 @@ The following BatchIterator adapters are available, for both `query` and `filter
107
107
You can use the `ContentService::find(Filter)` method to find Content items or
108
108
`LocationService::find(Filter)` to find Locations using a defined Filter.
109
109
110
-
`ContentService::find` returns an iterable [`ContentList`](https://github.com/ezsystems/ezplatform-kernel/blob/v1.1.0/eZ/Publish/API/Repository/Values/Content/ContentList)
111
-
while `LocationService::find` returns an iterable [`LocationList`](https://github.com/ezsystems/ezplatform-kernel/blob/v1.1.0/eZ/Publish/API/Repository/Values/Content/LocationList).
110
+
`ContentService::find` returns an iterable [`ContentList`](https://github.com/ezsystems/ezplatform-kernel/blob/v1.3.0/eZ/Publish/API/Repository/Values/Content/ContentList.php)
111
+
while `LocationService::find` returns an iterable [`LocationList`](https://github.com/ezsystems/ezplatform-kernel/blob/v1.3.0/eZ/Publish/API/Repository/Values/Content/LocationList.php).
112
112
113
113
Filtering differs from search. It does not use the `SearchService` and is not based on indexed data.
114
114
115
-
[`Filter`](https://github.com/ezsystems/ezplatform-kernel/blob/v1.1.0/eZ/Publish/API/Repository/Values/Filter/Filter.php) enables you to configure a query using chained methods to select criteria, sorting, limit and offset.
115
+
[`Filter`](https://github.com/ezsystems/ezplatform-kernel/blob/v1.3.0/eZ/Publish/API/Repository/Values/Filter/Filter.php) enables you to configure a query using chained methods to select criteria, sorting, limit and offset.
116
116
117
117
For example, the following command lists all Content items under the specified parent Location
118
118
and sorts them by name in descending order:
@@ -168,8 +168,8 @@ $filter
168
168
169
169
Not all Search Criteria and Sort Clauses are available for use in Repository filtering.
170
170
171
-
Only Criteria implementing [`FilteringCriterion`](https://github.com/ezsystems/ezplatform-kernel/blob/v1.1.0/eZ/Publish/SPI/Repository/Values/Filter/FilteringCriterion.php)
172
-
and Sort Clauses implementing [`FilteringSortClause`](https://github.com/ezsystems/ezplatform-kernel/blob/v1.1.0/eZ/Publish/SPI/Repository/Values/Filter/FilteringSortClause.php)
171
+
Only Criteria implementing [`FilteringCriterion`](https://github.com/ezsystems/ezplatform-kernel/blob/v1.3.0/eZ/Publish/SPI/Repository/Values/Filter/FilteringCriterion.php)
172
+
and Sort Clauses implementing [`FilteringSortClause`](https://github.com/ezsystems/ezplatform-kernel/blob/v1.3.0/eZ/Publish/SPI/Repository/Values/Filter/FilteringSortClause.php)
173
173
are supported.
174
174
175
175
See [Search Criteria](../guide/search/criteria_reference/search_criteria_reference.md)
@@ -203,7 +203,7 @@ When using Repository filtering, provide the results of `ContentService::find()`
203
203
204
204
### Paginating search results
205
205
206
-
To paginate search or filtering results, it is recommended to use the [Pagerfanta library](https://github.com/whiteoctober/Pagerfanta) and [[[= product_name =]]'s adapters for it.](https://github.com/ezsystems/ezplatform-kernel/tree/v1.0.0/eZ/Publish/Core/Pagination/Pagerfanta)
206
+
To paginate search or filtering results, it is recommended to use the [Pagerfanta library](https://github.com/whiteoctober/Pagerfanta) and [[[= product_name =]]'s adapters for it.](https://github.com/ezsystems/ezplatform-kernel/tree/v1.3.0/eZ/Publish/Core/Pagination/Pagerfanta)
207
207
208
208
```php
209
209
// ...
@@ -242,12 +242,12 @@ You can access the following additional search result data from PagerFanta:
242
242
243
243
|Adapter class name|Description|
244
244
|------|------|
245
-
|[`ContentSearchAdapter`](https://github.com/ezsystems/ezplatform-kernel/blob/v1.0.0/eZ/Publish/Core/Pagination/Pagerfanta/ContentSearchAdapter.php)|Makes a search against passed Query and returns [Content](https://github.com/ezsystems/ezplatform-kernel/blob/v1.0.0/eZ/Publish/API/Repository/Values/Content/Content.php) objects.|
246
-
|[`ContentSearchHitAdapter`](https://github.com/ezsystems/ezplatform-kernel/blob/v1.0.0/eZ/Publish/Core/Pagination/Pagerfanta/ContentSearchHitAdapter.php)|Makes a search against passed Query and returns [SearchHit](https://github.com/ezsystems/ezplatform-kernel/blob/v1.0.0/eZ/Publish/API/Repository/Values/Content/Search/SearchHit.php) objects instead.|
247
-
|[`LocationSearchAdapter`](https://github.com/ezsystems/ezplatform-kernel/blob/v1.0.0/eZ/Publish/Core/Pagination/Pagerfanta/LocationSearchAdapter.php)|Makes a Location search against passed Query and returns [Location](https://github.com/ezsystems/ezplatform-kernel/blob/v1.0.0/eZ/Publish/API/Repository/Values/Content/Location.php) objects.|
248
-
|[`LocationSearchHitAdapter`](https://github.com/ezsystems/ezplatform-kernel/blob/v1.0.0/eZ/Publish/Core/Pagination/Pagerfanta/LocationSearchHitAdapter.php)|Makes a Location search against passed Query and returns [SearchHit](https://github.com/ezsystems/ezplatform-kernel/blob/v1.0.0/eZ/Publish/API/Repository/Values/Content/Search/SearchHit.php) objects instead.|
249
-
|[`ContentFilteringAdapter`](https://github.com/ezsystems/ezplatform-kernel/blob/master/eZ/Publish/Core/Pagination/Pagerfanta/ContentFilteringAdapter.php)|Applies a Content filter and returns a `ContentList` object.|
250
-
|[`LocationFilteringAdapter`](https://github.com/ezsystems/ezplatform-kernel/blob/master/eZ/Publish/Core/Pagination/Pagerfanta/LocationFilteringAdapter.php)|Applies a Location filter and returns a `LocationList` object.|
245
+
|[`ContentSearchAdapter`](https://github.com/ezsystems/ezplatform-kernel/blob/v1.3.0/eZ/Publish/Core/Pagination/Pagerfanta/ContentSearchAdapter.php)|Makes a search against passed Query and returns [Content](https://github.com/ezsystems/ezplatform-kernel/blob/v1.3.0/eZ/Publish/API/Repository/Values/Content/Content.php) objects.|
246
+
|[`ContentSearchHitAdapter`](https://github.com/ezsystems/ezplatform-kernel/blob/v1.3.0/eZ/Publish/Core/Pagination/Pagerfanta/ContentSearchHitAdapter.php)|Makes a search against passed Query and returns [SearchHit](https://github.com/ezsystems/ezplatform-kernel/blob/v1.3.0/eZ/Publish/API/Repository/Values/Content/Search/SearchHit.php) objects instead.|
247
+
|[`LocationSearchAdapter`](https://github.com/ezsystems/ezplatform-kernel/blob/v1.3.0/eZ/Publish/Core/Pagination/Pagerfanta/LocationSearchAdapter.php)|Makes a Location search against passed Query and returns [Location](https://github.com/ezsystems/ezplatform-kernel/blob/v1.3.0/eZ/Publish/API/Repository/Values/Content/Location.php) objects.|
248
+
|[`LocationSearchHitAdapter`](https://github.com/ezsystems/ezplatform-kernel/blob/v1.3.0/eZ/Publish/Core/Pagination/Pagerfanta/LocationSearchHitAdapter.php)|Makes a Location search against passed Query and returns [SearchHit](https://github.com/ezsystems/ezplatform-kernel/blob/v1.3.0/eZ/Publish/API/Repository/Values/Content/Search/SearchHit.php) objects instead.|
249
+
|[`ContentFilteringAdapter`](https://github.com/ezsystems/ezplatform-kernel/blob/v1.3.0/eZ/Publish/Core/Pagination/Pagerfanta/ContentFilteringAdapter.php)|Applies a Content filter and returns a `ContentList` object.|
250
+
|[`LocationFilteringAdapter`](https://github.com/ezsystems/ezplatform-kernel/blob/v1.3.0/eZ/Publish/Core/Pagination/Pagerfanta/LocationFilteringAdapter.php)|Applies a Location filter and returns a `LocationList` object.|
0 commit comments