Skip to content

Add support for histogramHaving filter constraint #412

Description

@novoj

evitaDB 2026.2 introduces a new
filter constraint histogramHaving for slider-driven, per-histogram range
selection on references. We need to adapt evitaLab so the new constraint is
usable from the query editor and query builder.

What the new constraint does

histogramHaving(referenceName, histogramName, from, to, groupSelector?) is a
FilterConstraint usable inside userFilter. It narrows a reference histogram
to a [from, to] range (both ends inclusive) and optionally selects a single
group within a grouped reference via a single entityHaving(...) child.

  • referenceName — required classifier (the reference hosting the histogram)
  • histogramName — optional; may be omitted when the reference hosts exactly
    one histogram (empty string is normalised to null)
  • from / to — at least one must be non-null; when both are non-null they
    must share the same plain type and from <= to
  • groupSelector — optional single EntityHaving child identifying the group
    slot for grouped histograms

Inside userFilter it acts as a range carrier so the reference-histogram
baseline does not contract under its own slider handle. Outside userFilter
it behaves like the equivalent referenceHaving(...) rewrite.

Example:

userFilter(
    histogramHaving(
        "parameterValues", "basicUnitValue",
        50, 120,
        entityHaving(attributeEquals("code", "height"))
    ),
    histogramHaving(
        "parameterValues", "basicUnitValue",
        90, 140,
        entityHaving(attributeEquals("code", "weight"))
    )
)

What needs to change in evitaLab

  • Add histogramHaving to the codemirror-lang-evitaql plugin
    (auto-completion + documentation), following the
    process documented here.
  • Make sure the new plugin version is consumed by evitaLab.
  • Ensure the query editor and any query-builder UI surface the new constraint
    (including the optional histogramName and the optional single
    entityHaving group selector child).

References

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions