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

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Intro

Criteria are the filters for Content and Location Search in "Platform stack", for generic use of API Search see Search Criterions and Sort Clauses

Just like the other search related features: SortClauses and FacetBuilders/Facets, they consists of two parts:

  • Criterion, the API Value (Note: Criterion is singular form for Criteria)
  • Criterion Handler, specific handler per SearchEngine (Note: Implantation typically depends on SearchEngine capabilities/limitations)

Certain Criteria, like SortClauses, are only supported for LocationSearch, and is missing or has been deprecated from use with ContentSearch because they are location specific and gives unpredictable result when Content has several locations. These can been seen below starting with Location\.

The Criterion represent the value you use in the API, while CriterionHandler deals with the business logic in the background translating the value to something the Search engine can understand.

For how to use each and every Criterion, please consult with the API documentation as it depends on the Value, but in general a Criterion usually only care some of these three concepts:

  • target: Only exposed/used if the given Criterion supports targeting a specific sub section, example: FieldDefinition or Meta Data identifier
  • operator: Only exposed on some Criteria, others usually select EQ or IN depending on if value is scalar or array
    • Supported operator depends on Criterion, but it must be one of constants on eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator
      Note: IN
      BETWEEN always acts on array of values, while the other operators acts on single scalar value.
  • value: The value(s) to filter on, this is typically a  scalar or array of scalars.

List of Criteria

The list below reflects Criteria available in eZ\Publish\API\Repository\Values\Content\Query\Criterion namespace (it is also possible to make custom once not listed here):

CriterionConstructor arguments description
Location\Depth>= 5.3/2014.03 Filter using operator (IN, EQ, GT, GTE, LT, LTE, BETWEEN) and value being the location depth(s) as an integer(s).
Location\IsMainLocation>= 5.3/2014.03 Filter using value (Location\IsMainLocation::MAIN, Location\IsMainLocation::NOT_MAIN)
Location\Priority>= 5.3/2014.03 Filter using operator (GT, GTE, LT, LTE, BETWEEN) and value being the location priority(s) as an integer(s).
ContentIdFilter using value being scalar(s) representing the Content id.
ContentTypeGroupIdFilter using value being scalar(s) representing the ContentTypeGroup id.
ContentTypeIdFilter using value being scalar(s) representing the ContentType id.
ContentTypeIdentifier>= 5.1/2013.01 Filter using value being string(s) representing the ContentType identifier, example: "article"
DateMetadataFilter using target (DateMetadata::MODIFIED , DateMetadata::CREATED), operator (IN, EQ, GT, GTE, LT, LTE, BETWEEN), and value being integer(s) representing unix timestamp.
DepthDEPRECATED IN 5.3/2014.03
Field

Filter using target (FieldDefinition identifier), operator (IN, EQ, GT, GTE, LT, LTE, LIKE, BETWEEN, CONTAINS), and value being scalar(s) relevant for the field.

FieldRelation>= 5.3/2014.05 Filter using target (FieldDefinition identifier), operator (IN, CONTAINS), and value being array of scalars representing Content id of relation.
FullTextLIMITED ON LEGACY SEARCH ENGINE COMPARED TO UPCOMING SOLR / ELASTIC SEARCH IMPLEMENTATIONS
LanguageCodeFilter using value being string(s) representing Language Code(s) on the Content (not on Fields, see EZP-23524 - As a Developer I need support for field filters affecting queries in Legacy Search Engine Closed ), and as of 5.2/2013.11 matchAlwaysAvailable as boolean.
LocationIdFilter using value being scalar(s) representing the Location id.
LocationPriorityDEPRECATED IN 5.3/2014.03
LocationRemoteIdFilter using value being string(s) representing the Location Remote id.
LogicalAndA LogicalOperator that takes array of other Criteria, makes sure all Criteria matches.
LogicalNotA LogicalOperator that takes array of other Criteria, makes sure none of the Criteria matches.
LogicalOrA LogicalOperator that takes array of other Criteria, makes sure one of the Criteria matches.
MapLocationDistance>= 5.3/2014.03 Filter using target (FieldDefinition identifier), operator (IN, EQ, GT, GTE, LT, LTE, BETWEEN), distance as float(s), latitude as float, and longitude as float.
MatchAllMainly for internal use when no filter or query is provided on Query object.
MatchNoneMainly for internal use by BlockingLimitation.
MoreLikeThisNOT IMPLEMENTED
ObjectStateIdFilter using value being string(s) representing the Content ObjectState id.
ParentLocationIdFilter using value being scalar(s) representing the Location Parent id.
RemoteIdFilter using value being string(s) representing the Content Remote id.
SectionIdFilter using value being scalar(s) representing the Content Section id.
SubtreeFilter using value being string(s) representing the Location id.
UserMetadataFilter using target (UserMetadata::OWNER , UserMetadata::GROUP, UserMetadata::MODIFIER), operator (IN, EQ), and value being scalars(s) representing the User or UserGroup id(s).
VisibilityActs on one of the locations involved meaning when used with with ContentSearch hidden content will be returned if it has other location which is visible. Use LocationSearch to avoid this.
  • No labels