Skip to content

Latest commit

 

History

History
55 lines (42 loc) · 1.31 KB

File metadata and controls

55 lines (42 loc) · 1.31 KB
description LogicalAnd Search Criterion

LogicalAnd Criterion

The LogicalAnd Search Criterion matches content if all provided Criteria match.

When querying for products, use LogicalAnd instead.

Arguments

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

Example

PHP

$query->query = new Criterion\LogicalAnd([
        new Criterion\ContentTypeIdentifier('article'),
        new Criterion\SectionIdentifier(['sports', 'news']);
    ]
);

REST API

=== "XML"

```xml
<Query>
    <Filter>
        <AND>
            <ContentTypeIdentifierCriterion>article</ContentTypeIdentifierCriterion>
            <SectionIdentifierCriterion>news</SectionIdentifierCriterion>
        </AND>
    </Filter>
</Query>
```

=== "JSON"

```json
{
    "Query": {
        "Filter": {
            "AND": {
                "ContentTypeIdentifierCriterion": "article",
                "SectionIdentifierCriterion": "news"
            }
        }
    }
}
```