Global navigation

   Documentation Center
   eZ Studio & eZ Platform
     User Manual
     Technical Manual
     Glossary
   eZ Publish 4.x / legacy

 
eZ Publish (5.x)

eZ Publish 5.x | For eZ Platform & eZ Studio topics see Technical manual and User manual, for eZ Publish 4.x and Legacy topics see eZ Publish legacy

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

All Criterions and Sort Clauses will be accepted with Location Search, but not all of them can be used with Content Search. Reason for this is that while one Location always has exactly one Content item, one Content item can have multiple Locations. In this context some Criterions and Sort Clauses would produce ambiguous queries and such will therefore not be accepted by Content Search.

...

After you have implemented your Criterion / Sort Clause and its handler, you will need to configure the handler for the service container using dedicated service tags for each type of search. Doing so will automatically register it and handle your Criterion / Search Clause when it is given as a parameter to one of the Search Service methods.

Info

You will find all the native handlers and the tags for the Legacy Storage Engine available in the eZ/Publish/Core/settings/storage_engines/legacy/search_query_handlers.yml file.

Tags

Status
colourGreen
title>=5.4.2

Available tags for Criterion handlers in Legacy Storage Engine are:

  • ezpublish.persistencesearch.legacy.search.gateway.criterion_handler.content
  • ezpublish.persistencesearch.legacy.search.gateway.criterion_handler.location

Available tags for Sort Clause handlers in Legacy Storage Engine are:

  • ezpublish.persistencesearch.legacy.search.gateway.sort_clause_handler.content
  • ezpublish.persistencesearch.legacy.search.gateway.sort_clause_handler.location
Info

You will find all the native handlers and the tags for the Legacy Storage Engine available in the eZ/Publish/Core/settings/storage_engines/legacy/search_query_handlers.yml file.

Status
colourYellow
title<=5.3

Available tags for Criterion handlers in Legacy Storage Engine are:

  • ezpublish.persistence.legacy.search.gateway.criterion_handler.content
  • ezpublish.persistence.legacy.search.gateway.criterion_handler.location

Available tags for Sort Clause handlers in Legacy Storage Engine are:

  • ezpublish.persistence.legacy.search.gateway.sort_clause_handler.content
  • ezpublish.persistence.legacy.search.gateway.sort_clause_handler.location

Example of registering ContentId Criterion handler in 5.4.x, common for both Content and Location Search

Code Block
languagebash
titleRegistering Criterion handler
services:
    ezpublish.persistencesearch.legacy.search.gateway.criterion_handler.common.content_id:
        class: eZ\Publish\Core\PersistenceSearch\Legacy\Content\Search\Common\Gateway\CriterionHandler\ContentId
        arguments: [@ezpublish.api.storage_engine.legacy.dbhandler]
        tags:
          - {name: ezpublish.persistencesearch.legacy.search.gateway.criterion_handler.content}
          - {name: ezpublish.persistencesearch.legacy.search.gateway.criterion_handler.location}

Example of registering Depth Sort Clause handler in 5.3.x for Location Search

Code Block
languagebash
titleRegistering Sort Clause handler
ezpublish.persistence.legacy.search.gateway.sort_clause_handler.location.depth:
    class: eZ\Publish\Core\Persistence\Legacy\Content\Search\Location\Gateway\SortClauseHandler\Location\Depth
    arguments: [@ezpublish.api.storage_engine.legacy.dbhandler]
    tags:
        - {name: ezpublish.persistence.legacy.search.gateway.sort_clause_handler.location}

...