我想写个query, 查找上个月含有某个关键词的journal

{{query 我是关键字 ( between [[Jul 1st 2021, Thursday]] [[Jul 31st 2021, Saturday]] ) }}

我这么写为什么查出来的都不在指定日期范围, 而是把所有的都找出来了?

关键字写后边也不行…T^T

我还尝试了其他几种写法, 全都失败了:

{{query (and 我是关键字 ( between [[Jul 1st 2021, Thursday]] [[Jul 31st 2021, Saturday]] ) ) }}
{{query (and ( between [[Jul 1st 2021, Thursday]] [[Jul 31st 2021, Saturday]] 我是关键字 ) }}
{{query (我是关键字) ( between [[Jul 1st 2021, Thursday]] [[Jul 31st 2021, Saturday]] ) }}

哪位大佬给点提示? 谢啦

复制到一个空白块,自行修改关键词和日期

#+BEGIN_QUERY
{:title “Journals in 20210708 to 20210728 with a keyword of 关键词”
:query [:find (pull ?b [*])
:in $ ?pattern
:where
[?b :block/page ?p]
[?p :page/journal-day ?d]
[(>= ?d “20210708”)]
[(<= ?d “20210728”)]
[?b :block/content ?c]
[(re-pattern ?pattern) ?q]
[(re-find ?q ?c)]]
:inputs [“关键词”]}
#+END_QUERY

参考资料:
1.查询无scheduled的Todo(实用Query分享)
2.https://xutuan.vercel.app/#/page/logseq检索公式分享
3.https://logseq.github.io/#/page/advanced%20queries

1 个赞

收到!

引号修改之后可用, 非常感谢!

但是目前如果要修改查询, 则必须要放在新的block里查询, 否则一旦改动一点, 就会提示 invalid query

我研究一下语法.

我复制后更改关键和日期后显示invalid query。这个查询语法怪怪的

同上,可用。谢谢!