Repository navigation
Description
Summary
search_nodes matches its keyword against title. A node whose title is NULL therefore cannot be found by keyword at all, no matter what its content says — and compute_title leaves title NULL for a large, ordinary class of nodes.
Surfaced during the #2249 re-review. Pre-existing and not introduced by that PR — filed separately so it is not buried in a fix for a different bug.
Mechanism
compute_title (packages/core/src/services/node_service/crud.rs) resolves a title in this order:
date/schematypes → alwaysNone- Schema carries a
title_template→ built from properties - Otherwise, content-derived — but only for
task/collection, or for a root node
So a non-root node of any other type (a child text node, a nested instance of a user-defined type without a template) gets title: None and is invisible to keyword search.
Why it went unnoticed
Both search paths have the identical blind spot, so nothing looks inconsistent from the outside:
node_ops::query_nodesfilters on thetitleindexquery_ops::execute_queryfilters on thetitlecolumn (as of search_nodes silently ignoressortingwhenfiltersis empty — superlative queries return an arbitrary row #2249; it matchedcontentbefore, but that path was only reachable with a property filter also present)
The failure mode is the quiet kind this codebase keeps running into: count: 0 reported as a success, indistinguishable from "nothing matches".
Reproduction sketch
Create a non-root node of a template-less, non-task type whose content contains a distinctive word, then search_nodes for that word. Expect the node; get count: 0.
Possible directions
- Widen the keyword filter to match
title OR contenton both paths. Closest to what a user means by "search"; needs a decision on whether content matches should rank below title matches. - Populate
titlefor more node types — treat content-derived titles as the default rather than the root/task special case. Larger blast radius:titleis user-visible in the UI and in tool results, so this changes what is displayed, not just what is findable. - Leave matching as-is and surface the gap — have a zero-result search say that untitled nodes are not keyword-searchable. Weakest option; makes the limitation legible without fixing it.
Direction 1 looks right, but the ranking question should be settled before implementing.
Note
Worth checking whether the FTS path (node_fts) has the same blind spot or already indexes content independently — if it does, the two search surfaces disagree about what is findable, which is its own defect.
Activity
malibio commentedon Aug 23, 2026
Closing — this is the design working as intended, not a gap. My framing was wrong.
Non-root nodes are body contents. They are not supposed to be reachable via keyword search, and
titlebeing NULL for them is precisely the mechanism that encodes that: a title marks something as a document with its own identity, and body text under it is not separately addressable by keyword.That also resolves the open question I raised at the bottom of this issue — whether the two search surfaces disagree. They don't, they have different jobs:
node_ftsindexescontentfor every node, with no root/non-root distinction (v001_initial_schema.rs:98). Body text IS reachable, through FTS/semantic search.search_nodes's structured keyword filter matchestitle, which deliberately means "find me a document", not "find me any line of text that mentions this".So the three directions I sketched are all wrong to pursue. Direction 1 (
title OR content) would be actively harmful — it would make every body line a top-level structured search hit, flooding results with fragments the user did not ask for and eroding the distinction that makessearch_nodesuseful to an agent. Direction 2 would put titles on body nodes, changing what is displayed in the UI to fix a non-problem.No action needed. Recording this so the reasoning is findable if the same observation resurfaces: a
count: 0fromsearch_nodesfor text that exists in a body node is correct behavior, and the right route to that text is the FTS/semantic path.The #2249 fix (PR #2252) is unaffected — it made the two structured paths agree on filtering by title, which is the correct semantics either way.