netgen/ezplatform-search-extra
Netgen EzPlatformSearchExtra extends eZ Platform search with additional criteria, sort clauses, and search handlers, making it easier to build advanced content queries in templates and custom code.
This is a Symfony bundle for eZ Platform/Ibexa, not a Laravel package. In a Laravel codebase you would only encounter it when integrating with an eZ Platform/Ibexa application, typically as a headless CMS backend. Its day-to-day value is that it lets you express search queries using content type identifiers, section identifiers, object state identifiers, language codes, and user metadata instead of resolving database IDs first.
Minimal setup:
Install with Composer:
composer require netgen/ezplatform-search-extra
Register the bundle in config/bundles.php:
return [
// ...
Netgen\Bundle\EzPlatformSearchExtraBundle\NetgenEzPlatformSearchExtraBundle::class => ['all' => true],
];
On older Symfony versions, register it in app/AppKernel.php instead.
Clear the cache:
bin/console cache:clear
Look first at:
vendor/netgen/ezplatform-search-extra/lib/API/Values/Content/Query/Criterion
vendor/netgen/ezplatform-search-extra/lib/API/Values/Content/Query/SortClause
Those are the public query classes you will import.
First use case: query for article content in the news section without a ContentTypeId lookup:
use eZ\Publish\API\Repository\SearchService;
use eZ\Publish\API\Repository\Values\Content\Query;
use eZ\Publish\API\Repository\Values\Content\Query\Criterion\LogicalAnd;
use eZ\Publish\API\Repository\Values\Content\Search\SearchResult;
use Netgen\EzPlatformSearchExtra\API\Values\Content\Query\Criterion\ContentTypeIdentifier;
use Netgen\EzPlatformSearchExtra\API\Values\Content\Query\Criterion\SectionIdentifier;
final class ArticleController
{
public function __construct(private SearchService $searchService) {}
public function list(): SearchResult
{
$query = new Query();
$query->filter = new LogicalAnd([
new ContentTypeIdentifier('article'),
new SectionIdentifier('news'),
]);
$query->sortClauses = [
new Query\SortClause\DatePublished(Query::SORT_DESC),
];
$query->limit = 20;
return $this->searchService->findContent($query);
}
}
ContentTypeIdentifier, SectionIdentifier, ObjectStateIdentifier, and LanguageCode over ID-based criteria. This keeps configuration and API payloads human-readable and avoids extra repository lookups.latestInSection(), findByContentType(), and findForUser(). That makes criteria composable and testable.Criterion API and work inside LogicalAnd, LogicalOr, and LogicalNot. Mix them with core DatePublished, Visibility, Location, and ContentTypeId criteria when needed.ContentName and ContentTypeIdentifier let you sort in the search engine instead of post-processing in PHP. Keep pagination in the query with limit and offset, and use $result->totalCount for pager metadata.UserMetadata, use it for “my content” or personalized listings rather than loading all content and filtering in PHP. Check the exact value object shape under lib/API/Values.bin/console ezplatform:reindex or the Ibexa equivalent before smoke-testing the query.Typical reusable pattern:
final class ArticleSearch
{
public function __construct(private SearchService $searchService) {}
public function latestInSection(
string $sectionIdentifier,
int $limit = 20,
int $offset = 0
): SearchResult {
$query = new Query();
$query->filter = new LogicalAnd([
new ContentTypeIdentifier('article'),
new SectionIdentifier($sectionIdentifier),
]);
$query->sortClauses = [
new Query\SortClause\DatePublished(Query::SORT_DESC),
];
$query->limit = $limit;
$query->offset = $offset;
return $this->searchService->findContent($query);
}
}
composer.json constraints against your PHP, Symfony, and eZ Platform/Ibexa versions. On PHP 8.1+, Symfony 6, or Ibexa 4 it may not install or may conflict. Prefer core criteria or a maintained fork if available.eZ\Publish\API\Repository\Values\Content\Query\Criterion\ContentTypeId; this package has Netgen\EzPlatformSearchExtra\...\Criterion\ContentTypeIdentifier. They are not interchangeable. Import the Netgen class explicitly.filter for constraints, query for relevance. Put identifier criteria in $query->filter unless you intentionally want them to affect scoring. Mixing them into $query->query can produce surprising ranking.findContent versus findContentInfo. Sort clauses and some criteria may behave differently depending on whether you need content objects or content info. Use findContentInfo sparingly and verify extra criteria support it.bin/console debug:container to confirm the bundle is registered. Log the generated query, then inspect the search engine admin UI. If results are empty, remove criteria one at a time to isolate the unsupported one.How can I help you explore Laravel packages today?