Repository navigation
fix: index closed property values for search - #13438
Open
tiensonqin wants to merge 4 commits into
Open
tiensonqin wants to merge 4 commits into
tiensonqin wants to merge 4 commits into
Conversation
Closed values (property choice options) were excluded from the search index, so [[ links could never find or link them even by exact title. Bump search-db-version to rebuild existing indexes.
Contributor
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
Numeric (:number type) closed choices store the number in :logseq.property/value with no :block/title; index them by the value so [[ search can find them too.
…ric values - Gate the :logseq.property/value title fallback on ldb/closed-value? so ordinary numeric property values stay unindexed. - Watch :logseq.property/value datoms in get-affected-blocks and ref-affecting-attrs so numeric choice edits and retractions trigger reindex instead of leaving stale titles.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closed property values (choice options with
:block/closed-value-property) were skipped byblock->index, so they were never written to theblocks/blocks_ftssearch index. As a result,[[page search could never surface them — typing a choice's exact title offered only "New page" even though the entity existed (repro: anationalityproperty with choice "Emma North" scoped to#Personshows "Emma North" in its outline but[[Emma Northreturned only unrelated results).Changes:
(ldb/closed-value? block)clause from thewhen-notguard inblock->indexso closed values are indexed like other named entities.:block/title, index it by:logseq.property/value(stringified) — numeric:number-type choices store{:logseq.property/value 42}perclosed-value-new-block. Gated onldb/closed-value?so ordinary numeric property-value blocks stay unindexed.:logseq.property/valueto theget-affected-blockswatch set andref-affecting-attrsso editing or retracting a numeric choice's value reindexes it instead of leaving a stale title.search-db-version4 → 5 to force a re-index for existing graphs.block-index-uses-property-value-for-numeric-closed-choices,block-index-ignores-ordinary-numeric-value-blocks,sync-search-indice-reindexes-numeric-closed-choice-on-value-edit.Hidden/deleted entities remain excluded via
hidden-entity?; built-in/private pages still filtered byinclude-search-block?(built-in?+private-built-in-page?checks unchanged).Verified manually in the dev app: after the fix,
[[Emma Northlistsnationality → Emma North(the closed value) alongside the page/object results. All 68frontend.worker.search-testtests pass; kondo clean.Link to Devin session: https://app.devin.ai/sessions/a77503d623ca446890f381422e5678dc
Open in Devin Desktop: https://app.devin.ai/desktop/session/a77503d623ca446890f381422e5678dc?variant=devin
Requested by: @tiensonqin