Preferably in addition to the actual table output (or other rendering) of a query, perhaps just above the header row?
Logseq for example, shows:

Preferably in addition to the actual table output (or other rendering) of a query, perhaps just above the header row?
Logseq for example, shows:

Yes, just add a # in front of query like this:
Pages: ${#query[[from index.tag "page" where not table.includes(tags,"meta-") and not name:startsWith("Library/Std")]
Awesome, works great, thank you!
A minor question: it seems like I have to run the same query twice: once for the count, once for the actual results. To alleviate the performance concern, is it possible to get both in one shot? The renderer should know the number of rows I’d imagine, though that’d require a backend change that I’m not (yet) familiar with.
Yes. The steps to carry out:
(exemple below)
It’s all !
Example (the query is simplified to obtain a short list. If you get no results, add a #meta tag to one of your pages):
function listAndNb()
local listPages = query[[from index.tag "page" where table.includes(tags,"meta") and not name:startsWith("Library/Std") select name]]
local nbPages = #listPages
table.insert(listPages, 1, nbPages .. " pages in the list")
return listPages
end
and in your document, the result will be displayed with : ${listAndNb()}
Excellent, thank you a ton for both the idea and the code walkthrough, works great, and saved me a bunch of time!
Your response and other responses in this forum are helping me settle into Lua within space quickly. I suspected SilverBullet offers hackability, but it’s even nicer, easier, and more powerful than I’d expected so far!
If the result includes several fields (no select restriction), the result appears in table form.
To include the number of pages, you can do:
function listAndNb()
local listPages = query[[from index.tag "page" where table.includes(tags,"meta") and not name:startsWith("Library/Std")]]
local nbPages = #listPages
table.insert(listPages, 1, {name = "**<<< Search result: " .. nbPages .. " pages found >>>**"})
return listPages
end