Something like this:
#+BEGIN_QUERY
{:title "Testquery"
:inputs ["[[Meeting1]]" "searchString1" "searchString2"]
:query [:find ?date (pull ?b [*])
:in $ ?current ?string1 ?string2 %
:keys date b
:where
[?b :block/refs ?r]
[?r :block/name ?current]
(or-join [?b ?c1]
[?b :block/content ?c1]
(and
(descendant ?d ?b)
[?d :block/content ?c1]
)
)
[(clojure.string/includes? ?c1 ?string1)]
(or-join [?b ?c2]
[?b :block/content ?c2]
(and
(descendant ?d ?b)
[?d :block/content ?c2]
)
)
[(clojure.string/includes? ?c2 ?string2)]
[?b :block/page ?p]
[?p :block/journal-day ?date]
]
:result-transform (fn [results] (map :b (sort-by :date results)))
:rules [
[(descendant ?d ?b)
[?d :block/parent ?b]
]
[(descendant ?d ?b)
[?t :block/parent ?b]
(descendant ?d ?t)
]
]
}
#+END_QUERY