Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Ezplatform Search Extra Laravel Package

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.

Deep Wiki
Context7

Getting Started

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:

  1. Install with Composer:

    composer require netgen/ezplatform-search-extra
    
  2. 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.

  3. Clear the cache:

    bin/console cache:clear
    
  4. 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.

  5. 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);
        }
    }
    

Implementation Patterns

  • Identifier-first criteria. Prefer ContentTypeIdentifier, SectionIdentifier, ObjectStateIdentifier, and LanguageCode over ID-based criteria. This keeps configuration and API payloads human-readable and avoids extra repository lookups.
  • Wrap search in a service. Do not scatter query construction across controllers. Create a dedicated search service or query factory with methods such as latestInSection(), findByContentType(), and findForUser(). That makes criteria composable and testable.
  • Compose with core criteria. Extra criteria extend eZ’s Criterion API and work inside LogicalAnd, LogicalOr, and LogicalNot. Mix them with core DatePublished, Visibility, Location, and ContentTypeId criteria when needed.
  • Use sort clauses for presentation. Extra sort clauses such as 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.
  • Use user metadata for personalization. If the installed version exposes 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.
  • Keep it behind an abstraction. If the Laravel application consumes eZ/Ibexa over HTTP, expose search endpoints from the Symfony side rather than calling the bundle from Laravel. If you are working directly in the Symfony/Ibexa app, keep extra criteria in a repository or search service so controllers remain engine-agnostic.
  • Test against the real engine. Run integration tests against Solr or Elasticsearch, not just an in-memory or legacy engine. Reindex after deployment with 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);
    }
}

Gotchas and Tips

  • It is not Laravel. There is no service provider, no Eloquent integration, and no Laravel-style config file. It is a Symfony bundle for eZ Platform. In a Laravel project, treat it as an external CMS dependency and keep it behind an HTTP API or a dedicated integration service.
  • Maintenance risk. The last release was 2021-03-26. Check 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.
  • GPL-2.0 license. Unlike Laravel’s mostly MIT ecosystem, GPL can have distribution implications. Confirm with legal before shipping a derivative product.
  • Wrong criterion class. Core eZ has 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.
  • Search engine support varies. Criteria are implemented by search engine visitors. The legacy engine, Solr, and Elasticsearch may not support every criterion or sort clause. If a query silently returns zero results, check the engine and the criterion visitor.
  • Register the bundle. The criterion classes may autoload without bundle registration, but the engine visitors will not be registered. Queries can then fail or appear to ignore your filter.
  • Reindex after changes. Adding criteria or upgrading the package can require a Solr schema update and a full reindex. Clear the cache and run the reindex command before debugging application code.
  • Use 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.
  • Watch 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.
  • Debugging tip. Use 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.
  • Extension point. If you need a criterion the package does not provide, inspect how it registers criterion visitors for your search engine and add a custom visitor in your own bundle. Keep it version-pinned, because these internals are not a stable public API.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
frankyso/ipaymu
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
adachsoft/api-version-bundle
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core