Repository navigation
feat(search)!: filter and facet a root document on whether an entry’s leaf has a value - #1099
Merged
Merged
Conversation
… leaf has a value
An inline reference may list presenceLeaves: the projection writes one
${reference}_${leaf}_exists boolean per root document, true when any entry
holds a value for the leaf. A weld of one exists condition selects it, the
facet ‹reference›.‹leaf›.exists counts it, and GraphQL serves it under the
leaf in the reference’s where and facets. The presence ADR is renumbered to
40, after the other ADR that took number 38.
BREAKING CHANGE: PhysicalFields gains a required leafExists member, so code
constructing a PhysicalFields must supply it. An engine adapter must declare
each leaf boolean and compile a one-condition exists weld against it.
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.
Fix #1097
An inline reference may list leaves of its entries in
ref.presenceLeaves, so a root document is filtered and faceted on whether any entry holds a value for that leaf:${reference}_${leaf}_exists, true when any entry holds a value, false otherwise (no entries included). A per-entry boolean would count a work with entries[has, lacks]in both buckets. The name comes fromphysicalFields(reference).leafExists, the one source the projection, collection definition and compiler read.existscondition on a presence leaf selects the companion.existsamong several welded conditions is refused (exists-in-weld), as isexiststhrough a join. GraphQL rejectsexistsbeside another key of the same entry with the rewrite.‹reference›.‹leaf›.exists, served as‹Type›‹Reference›‹Leaf›Facets { exists: [BooleanBucket!]! }inside the reference’s facet object, beside its faceted leaves.presenceLeaveson a facetable reference, a leaf that is also a faceted leaf, and different presence leaves on two filterable references nesting the same Reference Type. Also refused: a leaf that istext,booleanor an inline reference, andpresenceLeaveson a lookup (Facet a root document on a leaf of the documents its lookup references #1090).BREAKING CHANGE:
PhysicalFieldsgains a requiredleafExistsmember, so code constructing aPhysicalFieldsmust supply it. An engine adapter must declare each leaf boolean and compile a one-conditionexistsweld against it. A type whose inline reference declares presence leaves is reached through a join by‹Type›JoinedWhere, and that reference by‹RefType›JoinedFilter, withoutexists.