Brix.Collection.FilterEngine (Brix v0.1.1)

Copy Markdown View Source

Evaluates filter groups against a list of pages.

Used by Brix.Store.Filesystem.list_collection_pages/1 to apply advanced collection filters. Pure function — no ETS dependency.

Summary

Functions

Filters pages by evaluating filter groups with the given group logic.

Functions

evaluate(pages, filter_groups, group_logic)

@spec evaluate([Brix.Page.t()], [Brix.Collection.FilterGroup.t()] | nil, :and | :or) ::
  [Brix.Page.t()]

Filters pages by evaluating filter groups with the given group logic.

Returns all pages when filter_groups is empty or nil.

Group logic

  • :and — page must pass ALL groups
  • :or — page must pass ANY group

Within each group, conditions combine according to the group's logic field.