Skip to content

[enh] indexer: add facets, MatchAll, and user-scoped lookup#364

Merged
asciimoo merged 3 commits intoasciimoo:masterfrom
FlameFlag:flameflag/push-uxqsrsuuosnw
Apr 22, 2026
Merged

[enh] indexer: add facets, MatchAll, and user-scoped lookup#364
asciimoo merged 3 commits intoasciimoo:masterfrom
FlameFlag:flameflag/push-uxqsrsuuosnw

Conversation

@FlameFlag
Copy link
Copy Markdown
Contributor

@FlameFlag FlameFlag commented Apr 22, 2026

Lays the groundwork for filter sidebars and smarter autocomplete on search

Search results can now come back with aggregate counts: which domains show up
most in your history, which languages, and how results break down by recency
(last 24h, 7 days, 30 days, year, older). That's what a sidebar needs to show
"GitHub (42), Wikipedia (17), ..." next to the results, or to power a recency
filter without a second round-trip

Autocomplete and filter UIs can also ask for these counts on their own, without
running a text search, so pulling the list of domains a user has visited is
cheap

Fixes a cross-user bug in URL lookup: in multi-user mode, looking up a URL could
return another user's copy of the same page. Callers can now scope the lookup to
the current user

@asciimoo
Copy link
Copy Markdown
Owner

Nice idea!

That's what a sidebar needs to show "GitHub (42), Wikipedia (17), ..."

How do you imagine displaying these information? Adding an extra sidebar doesn't make the search UI too dense?

Fixes a cross-user bug in URL lookup

This is a bug indeed, but you don't actually provide a solution for it, only tools that can solve the issue. GetByURLAndUser isn't used anywhere. In my opinion it would be good to fully replace GetByURL with GetByURLAndUser and use it everywhere instead of GetByURL.

@FlameFlag
Copy link
Copy Markdown
Contributor Author

How do you imagine displaying these information? Adding an extra sidebar doesn't make the search UI too dense?

This PR is only the backend groundwork so the frontend has something to call

But I was thinking:

  • Collapsible sidebar (hidden by default on narrow viewports, toggled from the header)
  • A compact filter bar above the results (chips like github.com · 42 that toggle as filters) instead of a full sidebar
  • Facets only surfaced on an explicit "filters" view, with autocomplete consuming the same endpoint silently

I lean toward the chip-bar for the density reason you mentioned, it keeps the main column unchanged when no filter is active, but I think this is for another PR

This is a bug indeed, but you don't actually provide a solution for it, only tools that can solve the issue. GetByURLAndUser isn't used anywhere. In my opinion it would be good to fully replace GetByURL with GetByURLAndUser and use it everywhere instead of GetByURL.

Ah, right I'll fix it

Callers pass the request's UserID so URL lookups can't return another
user's copy of the same page

The local file indexer passes 0 (no user context), and the semantic-hit
branch strips the uid prefix from docID since the vector search is
already scoped to q.UserID
Comment thread server/indexer/indexer.go Outdated
Copy link
Copy Markdown
Owner

@asciimoo asciimoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks!

@asciimoo asciimoo merged commit 52aabb7 into asciimoo:master Apr 22, 2026
7 checks passed
@FlameFlag FlameFlag deleted the flameflag/push-uxqsrsuuosnw branch April 22, 2026 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants