Skip to content

LogicalOr Criterion

The LogicalOr Search Criterion matches content if at least one of the provided Criteria matches.

Arguments

  • criterion - a set of Criteria combined by the logical operator

Example

PHP

1
2
3
4
5
$query->filter = new Criterion\LogicalOr([
        new Criterion\ContentTypeIdentifier('article'),
        new Criterion\SectionIdentifier(['sports', 'news']);
    ]
);

REST API

1
2
3
4
5
6
7
8
<Query>
    <Filter>
        <OR>
            <ContentTypeIdentifierCriterion>article</ContentTypeIdentifierCriterion>
            <SectionIdentifierCriterion>news</SectionIdentifierCriterion>
        </OR>
    </Filter>
</Query>
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
{
    "Query": {
        "Filter": {
            "OR": {
                "ContentTypeIdentifierCriterion": "article",
                "SectionIdentifierCriterion": "news"
            }
        }
    }
}