Repository navigation
Conversation
- Add @lde/cql2, which checks a CQL2 JSON filter against the properties it may name and tests records against it: =, in, a_contains, a_overlaps, and, or, over strings - Add the projection value matchedFilters: a field declared over it gets the value of every stored filter the document matches, tested at the field’s place in the declaration order - Add compileStoredFilters, which checks stored filters against the schema and refuses, in one error, a filter the schema cannot serve - Pass storedFilters through searchStages and searchIndexerPipeline, and extend the pipeline version with them - Read the filters from the file STORED_FILTERS_FILE names in the search indexer - Record the decision as ADR 45
ddeboer
force-pushed
the
feat/stored-search-membership
branch
from
November 25, 2026 13:23
a7bfc95 to
4c6710c
Compare
ddeboer
marked this pull request as ready for review
November 25, 2026 17:57
- Keep compileFilter, Cql2Expression and QueryableLookup as the surface of @lde/cql2 - Leave FilterMatcher out of the surface of @lde/search
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A run can now mark the documents that belong to a named subset of the index, and keep the index whole. One index, one API and one schema then serve any number of subsets, each with correct facet counts.
What changes
@lde/cql2(new): checks a CQL2 JSON filter against the properties it may name and tests records against it. It reads=,in,a_contains,a_overlaps,andandor, over strings, and refuses the rest. It knows nothing of search.@lde/search: a new projection value,from: 'matchedFilters'. A field declared over it gets the value of every stored filter the document matches.compileStoredFilters(schema, filters)checks the filters against the schema and reports every mistake in one error.@lde/search-pipeline:storedFiltersonsearchStagesandsearchIndexerPipeline. The filters extend the pipeline version.@lde/search-indexer:STORED_FILTERS_FILEnames a JSON file with the filters.[ { "type": "CreativeWork", "value": "https://example.org/selections/pottery", "filter": { "op": "a_contains", "args": [{ "property": "about" }, ["https://example.org/terms/pottery"]] } } ]Declared filterable and not facetable, a
whereclause on the field is no facet’s own, so every facet counts within the subset. ADR 45 has the reasoning and the limits. It takes up the need behind #1024 for subsets known at indexing time.Measured
Linked Open Limburg, a full local reindex with images built from this branch (19748 works, 2m42s), one stored filter on
about:whereaboutbucketaboutin [term]collectionin [subset]The filter names an authority’s IRI and matches works that point to a publisher’s own term: a reference holds its target’s key before the filter reads it.
To know before merging
@traqula/*to the workspace’s versions by hand, which the image lockfile step now does itself.@lde/cql2is not on npm yet, so it needs the manual first publish right after the merge.@lde/searchdepends on it.cql2-wasm0.5.6 was tried first. It throws on=against an absent property and accepts an unknown operator as valid, so the evaluator is our own.