Splitting Strategy
Predicate Classification
| Predicate Type | Execution Stage | Lucene-Compatible |
|---|---|---|
Equality (eq) | Lucene query | Yes |
Inequality (ne, !=) | Lucene query | Yes |
| Null check | Lucene query | Yes (via HAS_VALUE) |
| AND composite | Lucene query | Yes |
| OR composite | Lucene query | Yes |
| NOT (unary) | Lucene query | Yes |
| Object ID with project prefix | Lucene query | Yes |
| Complex navigation predicates | Post-filter | No |
| Predicates on expanded properties | Post-filter | No |
Query Execution Pipeline
The query processor follows this execution order:- Predicate analysis — Classify each predicate as Lucene-compatible or post-filter
- Lucene query construction — Combine Lucene-compatible predicates with type and project constraints
- Database execution — Execute Lucene query against Polarion
IDataService - Post-filter application — Apply remaining predicates in memory on the result set
- Expansion path resolution — Load related entities via expansion paths
- Security enforcement — Verify entity-level read permissions
Document Query Optimization
When thewhere clause contains document-level predicates (e.g., filtering by document properties), the query processor extracts these predicates and pre-resolves matching documents before querying work items. This reduces the work item query scope by restricting it to items within specific documents.
| Step | Action | Result |
|---|---|---|
| 1 | Extract document predicates from where clause | Document filter criteria |
| 2 | Resolve matching documents | List of document IDs |
| 3 | Add document.id constraint to work item query | Scoped Lucene query |
| 4 | Execute constrained work item query | Reduced result set |
The exact set of predicates classified as document-level depends on the query structure. Verify query execution plans using the
explain query parameter when available.Query Parameters
The query processor extracts parameters that control query behavior.| Parameter | Type | Default | Description |
|---|---|---|---|
revision | string | null | Execute query against a specific baseline revision |
currentDoc | string | null | Document ID filter for document-scoped queries |
currentDocConstraint | string | null | Entity type or expansion path for document scoping |
explain | boolean | false | Enable debug output for query execution |
Security Enforcement
Before any query executes, the processor verifies that the current user has read permission for the queried entity type. Queries against unauthorized entity types fail immediately without executing the Lucene query.Constraint Annotations
The query processor applies constraint annotations from the domain model to queries:- Project constraints from entity type annotations are merged into the Lucene query
- Document constraints from entity type and expansion path annotations are merged into document filters
- Navigation property constraints combine both the expansion path and target entity type constraints
Complete YAML Example
- The
whereclause contains Lucene-compatible predicates (type:andHAS_VALUE:) - The
applyCurrentDocumentToconstraint restricts results to the current document context - Expansion paths load related entities after the primary query executes
Related Pages
- Lucene Integration — Lucene query syntax and translation
- Predicates — predicate types and syntax
- Document Filtering — document-level query constraints
- Project Scoping — automatic project filtering
- Expand Clause — expansion path configuration
Source context: PolarionQueryProcessor, GenericQueryResolver, QueryToLuceneTest, powersheet.yaml
Sources
Sources
Source Code
PolarionQueryProcessor.javapowersheet.yamlGenericQueryResolver.javaprod-powersheet-src/com.nextedy.powersheet.client/src/modules/ModelProvider/ModelProvider.tsxQueryDataTest.java