Skip to content

IsFieldEmpty Criterion

The IsFieldEmpty Search Criterion searches for content based on whether a specified Field is empty or not.

Arguments

  • fieldDefinitionIdentifier - string representing the identifier of the Field
  • (optional) value - bool representing whether to search for empty (default true), or non-empty Fields (false).

Limitations

The IsFieldEmpty Criterion is not available in Repository filtering.

The Richtext Field Type (ezrichtext) is not searchable in the Legacy search engine.

Example

1
$query->query = new Criterion\IsFieldEmpty('title');

Use case

You can use the IsFieldEmpty Criterion to search for articles that do not have an image:

1
2
3
4
5
6
$query = new LocationQuery;
$query->query = new Criterion\LogicalAnd([
        new Criterion\ContentTypeIdentifier('article'),
        new Criterion\IsFieldEmpty('image'),
    ]
);