Skip to main content

Operator Categories

diagram

Comparison Operators

Comparison operators evaluate a property value against a constant.
OperatorAliasDescriptionSupported Types
eq==Equality. Case-sensitive for strings.String, number, boolean
ne!=Inequality.String, number, boolean
gt>Greater than.Number (Integer, Double, Long), date
ge>=Greater than or equal.Number, date
lt<Less than.Number, date
le<=Less than or equal.Number, date
containsSubstring match. Case-sensitive.String

Equality (eq / ==)

{ "title": { "eq": "Safety Requirement" } }
Shorthand:
{ "title": "Safety Requirement" }
Both forms produce the same Lucene query: title:"Safety Requirement".

Inequality (ne / !=)

{ "status": { "ne": "rejected" } }
Translates to Lucene NOT prefix syntax.

Greater Than (gt / >)

{ "priority": { "gt": 3 } }
Greater than, less than, and range operators work with Integer, Double, and Long values. They are not applicable to string or boolean properties.

Less Than or Equal (le / <=)

{ "severity": { "le": 5 } }
Inclusive upper bound — commonly used for range filtering.

Contains

{ "title": { "contains": "safety" } }
Case-sensitive substring match. Commonly used in search-as-you-type scenarios.

Null Operators

Null checks use eq and ne with a null value:
ExpressionLucene TranslationDescription
{ "prop": { "eq": null } }NOT HAS_VALUE:propProperty has no value
{ "prop": { "ne": null } }HAS_VALUE:propProperty has a value
The HAS_VALUE pseudo-field is a Polarion-specific Lucene construct for checking property existence.

Logical Operators

Logical operators combine multiple predicates.

AND (and / &&)

All sub-predicates must match:
{
  "and": [
    { "status": { "eq": "approved" } },
    { "priority": { "gt": 2 } }
  ]
}
Translates to: (status:"approved") AND (priority:{2 TO *})

OR (or / ||)

Any sub-predicate may match:
{
  "or": [
    { "status": "draft" },
    { "status": "in_review" }
  ]
}
Translates to: (status:"draft") OR (status:"in_review")

NOT (not / !)

Negates a predicate:
{
  "not": { "status": { "eq": "obsolete" } }
}
NOT can negate any predicate type, including composite predicates:
{
  "not": {
    "or": [
      { "status": "rejected" },
      { "status": "obsolete" }
    ]
  }
}
AND binds more tightly than OR. Use nesting to control evaluation order. Each operand in composite predicates is parenthesized during Lucene translation.

Nested Composite Operators

AND and OR can be nested for complex filtering logic:
{
  "and": [
    { "priority": { "ge": 3 } },
    {
      "or": [
        { "status": "approved" },
        { "status": "in_review" }
      ]
    }
  ]
}
Resulting Lucene: (priority:[3 TO *]) AND ((status:"approved") OR (status:"in_review"))

Collection Operators

Collection operators evaluate predicates against multi-valued properties.
OperatorAliasDescription
anysomeReturns true if any element in the collection matches the condition
alleveryReturns true if all elements in the collection match the condition
Collection operators are used for filtering across related entity collections. The exact query syntax for any and all with nested property conditions depends on the entity type metadata.

Lucene Translation Summary

Query OperatorLucene Output
{ "name": "John" }name:"John"
{ "count": 5 }count:5
{ "prop": { "ne": "X" } }NOT prop:"X"
{ "prop": { "eq": null } }NOT HAS_VALUE:prop
{ "prop": { "ne": null } }HAS_VALUE:prop
{ "and": [...] }(...) AND (...)
{ "or": [...] }(...) OR (...)
{ "not": {...} }NOT (...)
For detailed translation rules, see Lucene Integration.

Where Clause Merging

When multiple filter conditions are combined (e.g., from user filters and configuration constraints), Powersheet merges them using these rules:
  • Two AND conditions: arrays are concatenated
  • Two OR conditions: arrays are concatenated
  • AND + OR: the OR is wrapped inside the AND
  • Property conflicts: the second value overrides the first
  • Empty/undefined conditions are ignored

Complete YAML Example

sources:
  - id: filtered
    title: Active Requirements
    model: rtm
    query:
      from: UserNeed
      where:
        and:
          - title:
              ne: null
          - or:
              - status: approved
              - status: in_review
          - priority:
              ge: 3
    expand:
      - name: systemRequirements

Sources: Code: Operator.java, QueryToLuceneTest.java, QueryExecutorTest.java, odata-where-merger.test.ts, parseConstraints.test.ts
Source Code
  • Operator.java
  • prod-powersheet-src/com.nextedy.powersheet.client/ltc-repo/__tests__/parseConstraints.test.ts
  • GenericQueryResolver.java
  • QueryToLuceneTest.java
  • QueryProcessor.java