Fix #8128: Fix filter_elements skipping groups after a zero-result facet_list

When a `+`-separated filter group returns no results, `FacetTransformer.facet_list`
was skipping the reset of `has_additive_facet_in_current_list` because the reset
was inside the `if self.elements:` guard. The stale flag caused the next group's
`add_default_elements()` to bail out early, leaving its element set empty and
silently dropping every subsequent group from the result.

Move the flag reset outside the guard so it always fires regardless of whether
the group produced any results.
This commit is contained in:
Ryan Schultz
2026-05-30 16:28:14 -05:00
parent 3dd3a0d70c
commit fd96e6a4d2
@@ -916,7 +916,7 @@ class FacetTransformer(lark.Transformer):
if self.elements:
self.results.append(self.elements)
self.elements = set()
self.has_additive_facet_in_current_list = False
self.has_additive_facet_in_current_list = False
def instance(self, args):
self.has_additive_facet_in_current_list = True