mirror of
https://github.com/logseq/logseq.git
synced 2026-05-01 09:26:28 +00:00
Merge branch 'master' into feat/db
This commit is contained in:
@@ -480,12 +480,11 @@ Some bindings in this fn:
|
||||
(string/replace tag-placeholder "#")))))
|
||||
|
||||
(defn- add-bindings!
|
||||
[form q]
|
||||
[q]
|
||||
(let [forms (set (flatten q))
|
||||
syms ['?b '?p 'not]
|
||||
[b? p? not?] (-> (set/intersection (set syms) forms)
|
||||
(map syms))
|
||||
or? (contains? (set (flatten form)) 'or)]
|
||||
(map syms))]
|
||||
(cond
|
||||
not?
|
||||
(cond
|
||||
@@ -501,16 +500,6 @@ Some bindings in this fn:
|
||||
:else
|
||||
q)
|
||||
|
||||
or?
|
||||
(cond
|
||||
(->> (flatten form)
|
||||
(remove (every-pred string? page-ref/page-ref?))
|
||||
(some string?)) ; block full-text search
|
||||
(concat [['?b :block/content '?content]] [q])
|
||||
|
||||
:else
|
||||
q)
|
||||
|
||||
(and b? p?)
|
||||
(concat [['?b :block/page '?p]] q)
|
||||
|
||||
@@ -554,8 +543,7 @@ Some bindings in this fn:
|
||||
;; [(not (page-ref ?b "page 2"))]
|
||||
(keyword (ffirst result))
|
||||
(keyword (first result)))]
|
||||
(add-bindings! form
|
||||
(if (= key :and) (rest result) result))))]
|
||||
(add-bindings! (if (= key :and) (rest result) result))))]
|
||||
{:query result'
|
||||
:rules (if db-graph?
|
||||
(rules/extract-rules rules/db-query-dsl-rules rules)
|
||||
|
||||
Reference in New Issue
Block a user