Skip to content

Interactive Explorer: Facet counts wrong when filtering by multiple facet values #304

Closed

Description

@ekansa

The Interactive Explorer appears to work as expected when one filters by 1 facet value. The facet counts update appropriately.

However, when one applies multiple facet values as filters (for example when one filters by "Material: Anthropogenic material" and "Specimen Type: Artifact" then the facet values are wrong.

Activity

  1. added theissue type on Jun 19, 2026
  2. rdhyee commented on Jun 19, 2026

    @rdhyee
    Contributor

    Thanks Eric — confirmed, and you've pinpointed it exactly. Here's what's going on in plain English.

    You're right that it works for one filter but breaks for several. When you pick a single facet value, the counts are served from a precomputed lookup table that already knows "if this one thing is selected, here's what every other facet's count should be." That table only covers the one-filter case. The moment you select a second value (your Material: Anthropogenic material + Specimen Type: Artifact example), that shortcut no longer applies.

    What happens then: at the zoomed-out / world view, instead of recalculating the combined counts, the other facets quietly fall back to their full, unfiltered totals. So the numbers you see aren't "wrong math" — they're the global counts showing through where cross-filtered counts should be. That's why it looks broken.

    Two things worth knowing:

    • The map itself is still correct. The dots/samples shown are properly filtered by all your selections — it's specifically the facet count numbers that mislead in this case.
    • Zooming in fixes the counts. Once you're not at the world view, the counts are recalculated live and do reflect all active filters. So this is specifically a zoomed-out-view problem.

    Why it's like this: computing combined counts across the whole dataset at world view used to require scanning a ~39M-row table, which stalls the in-browser database — so that path was deliberately left showing the baseline rather than hanging.

    The fix: we recently shipped a compact "bitmask" index (#299) precisely so this kind of multi-filter calculation can be done in one fast pass instead of the slow 39M-row scan. The plan is to use it to compute the combined counts at world view too, so the numbers stay correct no matter how many facets you select. Related: #230, #276.

    Will follow up here when the fix lands.

  3. ekansa commented on Jun 19, 2026

    @ekansa
    ContributorAuthor

    Do the fix.

    Also, if a user selects a combination of filters that does not have pre-computed counts, then make sure the user interface does NOT show inaccurate numbers.

  4. added 9 commits that reference this issue on Jun 20, 2026
  5. added 2 commits that reference this issue on Jun 26, 2026
  6. added 4 commits that reference this issue on Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    explorerInteractive Explorer features

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions