Repository navigation
Query: text conditions run through gufi_vt; an unbuilt main folder is "not indexed yet" - #597
Merged
Merged
Conversation
… "not indexed yet" A Query across libraries with a "has the words" condition answered through the per-library merge, not gufi_vt. gufi_vt takes each SQL stage as a double-quoted value read verbatim, so the Studio refused any stage holding a double quote, and a text condition always has them: its FTS5 phrase query is MATCH '"a" AND "b"'. A double quote inside a single-quoted string is now written for gufi_vt as '||char(34)||', which gives the same string, so text conditions run through gufi_vt with the rows the merge gives. A double quote outside a string (a quoted identifier, a comment) still sends the query to the merge. A Query across libraries answered by the merge now carries mergeReason saying why. The main folder counted as indexed whenever its index folder existed, even empty before the first build. Search then found nothing there and named nothing, while Query ran gufi_query, failed, and said "index not found". It now counts as indexed once its index has a db.db at the root, as the index status already does, and both name it alike: "not indexed yet" before its first build, "index not found" for one built before whose index is gone. check_app.sh's gufi_vt check adds a query with a words condition.
…n gufi_vt too The one walk (#596) is the default search; the gufi_vt setting takes its own route, through the same check before anything runs.
Matthew Shaxted (mattshax)
force-pushed
the
query-vt-words
branch
from
October 25, 2026 13:34
9465251 to
07001d3
Compare
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.
Two Query issues found by the macOS end-to-end test on v1.174.
Text conditions fell back to the merge. A Query across libraries with a "has the words" condition answered with
engine: "merge", while name and size conditions used gufi_vt. gufi_vt takes each SQL stage as a double-quoted value (E="...") read verbatim, sofitsVtrefused any stage holding a double quote, and a text condition always holds them: #583 writes its FTS5 phrase query aswordf MATCH '"a" AND "b"'.vtStage()inserver/src/gufiVt.tswrites each double quote inside a single-quoted string as'||char(34)||', wrapping the literal in parentheses. The string's value is unchanged: FTS5 matches the computed phrase string the same as the literal (checked with gufi_sqlite3). A double quote outside a string (a quoted identifier, a comment) or an unterminated string still leaves the query to the merge.vtScriptpasses every stage through it, so remote locations' command lines carry no inner double quotes either.mergeReason: a double quote outside a string, a library path gufi_vt cannot be given, no gufi_vt with remote locations, or the gufi_vt statement's error.An unbuilt main folder. The main folder counted as indexed whenever its index folder existed (
gufiAvailable()), including the empty folder that exists before the first build. Search then found no databases and named nothing, while Query ran gufi_query, failed, and listed it as "index not found".db.dbat the root, asindexStatus().indexedalready does.libraryGapsaysnot indexed yetfor the main folder before its first build, and keepsindex not foundfor one built before whose index is gone (indexing.ts reports whether the last build of the main folder finished).omittedand does not ask it; Query across libraries lists it the same way, and asked alone answers 409<label> cannot be queried: not indexed yet.Tests
gufiVtSpaces.test.mjs:vtStagerewrites (phrase quotes, a doubled single quote, a quoted identifier, a comment, an unterminated string); with real GUFI, a words condition across a local library and one through the remote wrapper answersengine: "gufi_vt"with the rows the merge gives; the merge carries its reason.omissions.test.mjs: with real GUFI, search and Query name a never-built main foldernot indexed yet(its empty index folder present), andindex not foundonce built and itsdb.dbis moved away; nothing is named once it is back.querySql.test.mjs: its stand-in main index gets adb.db, as a built index has.deploy/mac/check_app.sh: after the existing gufi_vt check across two libraries, a Query with a words condition on the OCR sample word must answerengine: "gufi_vt"with the sample in its rows.docs/REFERENCE.mddescribes both.