This documentation is for a version that has reached its End Of Life. Such versions are no longer supported and don't receive security updates. Consider updating to a newer version.
Search Criteria reference¶
Search Criteria are filters for content and location Search and Repository filtering.
Criteria can take some of the following arguments:
target
- when the Criterion supports targeting a specific field, example:FieldDefinition
or Metadata identifiervalue
- the value(s) to filter on, typically a scalar or array of scalarsoperator
- constants onIbexa\Contracts\Core\Repository\Values\Content\Query\Criterion\Operator
:IN
,EQ
,GT
,GTE
,LT
,LTE
,LIKE
,BETWEEN
,CONTAINS
. Most Criteria don't expose this and selectEQ
orIN
depending on whether the value is scalar or an array.IN
andBETWEEN
always act on an array of values, while the other operators act on single scalar valuevalueData
- additional value data, required by some Criteria, for instanceMapLocationDistance
Support and capabilities of individual Criteria can depend on the search engine.
In the Legacy search engine, the field index/sort key column is limited to 255 characters by design. Due to this storage limitation, searching content using the Country field type or Keyword when there are multiple values selected may not return all the expected results.
Search Criteria¶
Search Criterion | Search based on | Content Search | Location Search | Filtering |
---|---|---|---|---|
Ancestor | Whether the content item is an ancestor of the provided location | ✔ | ✔ | ✔ |
ContentId | Content item's ID | ✔ | ✔ | ✔ |
ContentName | Content item's name | ✔ | ✔ | ✔ |
ContentTypeGroupId | ID of the content item's content type group | ✔ | ✔ | ✔ |
ContentTypeId | ID of the content item's content type | ✔ | ✔ | ✔ |
ContentTypeIdentifier | Identifier of the content item's content type | ✔ | ✔ | ✔ |
CurrencyCodeCriterion | Currency code | ✔ | ✔ | ✔ |
DateMetadata | The date when content was created or last modified | ✔ | ✔ | ✔ |
Depth | Location depth in the content tree | ✔ | ✔ | |
Field | Content of one of content item's fields | ✔ | ✔ | |
FieldRelation | Content items the content in question has Relations to | ✔ | ✔ | |
FullText | Full text content of a content item's fields | ✔ | ✔ | |
Image | Image by specified image attributes | ✔ | ✔ | |
ImageDimensions | Image dimensions: height and width | ✔ | ✔ | |
ImageFileSize | Image size in MB | ✔ | ✔ | |
ImageHeight | Image height in pixels | ✔ | ✔ | |
ImageMimeType | Image type | ✔ | ✔ | |
ImageOrientation | Image orientation | ✔ | ✔ | |
ImageWidth | Image width in pixels | ✔ | ✔ | |
IsBookmarked | Whether a location is bookmarked or not | ✔ | ✔ | |
IsCurrencyEnabledCriterion | Whether a specified currency is enabled in the system | |||
IsFieldEmpty | Whether a specified field of a content item is empty or not | ✔ | ✔ | |
IsMainLocation | Whether a location is the main location of a content item | ✔ | ✔ | |
IsProductBased | Whether content represents a product | ✔ | ✔ | ✔ |
IsUserBased | Whether content represents a User account | ✔ | ✔ | ✔ |
IsUserEnabled | Whether a User account is enabled | ✔ | ✔ | ✔ |
LanguageCode | Whether a content item is translated into the selected language | ✔ | ✔ | ✔ |
LocationId | Location ID | ✔ | ✔ | ✔ |
LocationRemoteId | Location remote ID | ✔ | ✔ | ✔ |
MapLocationDistance | Distance between the location contained in a MapLocation field and the provided coordinates | ✔ | ✔ | |
MatchAll | Returns all search results | ✔ | ✔ | ✔ |
MatchNone | Returns no search results | ✔ | ✔ | ✔ |
ObjectStateId | Object state ID | ✔ | ✔ | ✔ |
ObjectStateIdentifier | Object state Identifier | ✔ | ✔ | ✔ |
ParentLocationId | Location ID of a content item's parent | ✔ | ✔ | ✔ |
ParentLocationRemoteId | Location remote ID of a content item's parent | ✔ | ✔ | |
Priority | Location priority | ✔ | ✔ | |
RemoteId | Remote content ID | ✔ | ✔ | ✔ |
SectionId | ID of the Section content is assigned to | ✔ | ✔ | ✔ |
SectionIdentifier | Identifier of the Section content is assigned to | ✔ | ✔ | ✔ |
Sibling | Locations that are children of the same parent | ✔ | ✔ | ✔ |
Subtree | Location subtree | ✔ | ✔ | ✔ |
TaxonomyEntryId | Content tagged with Entry ID | ✔ | ✔ | ✔ |
UserEmail | Email address of a User account | ✔ | ✔ | ✔ |
UserId | User ID | ✔ | ✔ | ✔ |
UserLogin | User login | ✔ | ✔ | ✔ |
UserMetadata | The creator or modifier of a content item | ✔ | ✔ | ✔ |
Visibility | Whether the content item is visible or not | ✔ | ✔ | ✔ |
Logical operators¶
All Logical operators are supported by Content and Location Search and Repository filtering.
Search Criterion | Search based on |
---|---|
LogicalAnd | Implements a logical AND Criterion. It matches if ALL of the provided Criteria match. |
LogicalNot | Implements a logical NOT Criterion. It matches if the provided Criterion doesn't match. |
LogicalOr | Implements a logical OR Criterion. It matches if at least one of the provided Criteria matches. |