fix: and-or query

This commit is contained in:
ksqsf
2023-12-04 13:53:59 +08:00
committed by Gabriel Horner
parent 31a52d6f8d
commit ef60c92e30
2 changed files with 22 additions and 18 deletions

View File

@@ -480,8 +480,7 @@ Some bindings in this fn:
(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
@@ -497,16 +496,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)