Behavioral filtering containers
Special behavioural filter constraint containers are used to define a filter constraint scope, which has a different treatment in calculations, or to define a scope in which the entities are searched.
Scope
- argument:enum(LIVE|ARCHIVED)+
mandatory one or more enum arguments representing the scope to be searched for the result
- LIVE - the default scope, which searches the live data for the result
- ARCHIVED - the scope that searches for the result in the archived data.
Unique constraints are only enforced within the same scope. This means that two entities in different scopes can have the same unique attribute value. When you move an entity from one scope to another, the unique constraints within the target scope are checked and if the entity violates the unique constraint, the move is refused.
This is not what developers expect when working with archived entities - they expect the query to return all the entities that match all the constraints that are applicable (indexed) for a particular scope, and to ignore the constraints that cannot be computed for that scope. So, in practice, they expect the query to be translated:
This means that when both scopes are queried, the engine constructs two complement queries, each containing only the constraints that apply to that scope, and ignoring other constraints. If there is no constraint left for a particular scope, the whole scope is omitted so that the result isn't polluted with all the entities from the scope (super set).
This hybrid behaviour makes it much easier for applications to use, because the application doesn't have to construct different or more complex queries (to target only the indexed data) when both live and archived data are being queried, and the engine does the heavy lifting for them. On the other hand, if only a single area is targeted, the engine is strict and checks that all the constraints apply to that area (queries are expected to be tailored for that area).
Producing the following result:
Producing the following result:
User filter
- filterConstraint:any+
one or more mandatory filter constraints that will produce logical conjunction
Facet summary with facetHaving in userFilter | Facet summary without userFilter scope |
---|---|
Before | After |