feat: emit Lucene filters for KV items direct_read optimization#2301
Conversation
Sidebar and dashboard filters now emit Lucene conditions instead of raw SQL, enabling the KV items direct_read optimization on Map columns (e.g. LogAttributes, ResourceAttributes). This routes filter equality checks through the Lucene serializer's eq() path which rewrites to has(KvItemsColumn, concat(key, sep, value)) when a text(tokenizer=array) index exists. - filtersToQuery emits type:'lucene' for all filters (range stays SQL) - parseLuceneFilter uses the existing Lucene parser + decodeSpecialTokens - Removed stringifyKeys option (Lucene serializer handles JSON toString) - Added AGENTS.md guidance on reusing existing utility functions
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🟡 Tier 3 — StandardIntroduces new logic, modifies core functionality, or touches areas with non-trivial risk. Why this tier:
Review process: Full human review — logic, architecture, edge cases. Stats
|
PR ReviewSolid change overall — clean refactor to route filter equality through the Lucene path so KV
Nothing here is a merge blocker beyond the first two items, which I'd address before shipping since both can silently corrupt user-saved URL state. |
Deep ReviewScope: 13 files changed, ~990 net additions. Sidebar/dashboard filters now emit Lucene conditions instead of SQL 🔴 P0/P1 — must fix
🟡 P2 — recommended
🔵 P3 nitpicks (10)
Reviewers (11): correctness, testing, maintainability, adversarial, kieran-typescript, api-contract, performance, reliability, project-standards, agent-native, learnings-researcher. Testing gaps:
|
E2E Test Results✅ All tests passed • 178 passed • 3 skipped • 1226s
Tests ran across 4 shards in parallel. |
🦋 Changeset detectedLatest commit: 0715ffb The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Summary
Sidebar and dashboard filters now emit Lucene conditions instead of raw SQL, enabling the KV items direct_read optimization on Map columns (e.g. LogAttributes, ResourceAttributes). This routes filter equality checks through the Lucene serializer's eq() path which rewrites to has(KvItemsColumn, concat(key, sep, value)) when a text(tokenizer=array) index exists.
Steps:
has(ResourceAttributeItems, concat('key', '=', 'value')References