rules

(xt/query-list xtdb
'{:find  [(pull b [*])]
  :in    [[word ...]]
  :where [[b :label :book/book]
          (or (title-include? b word)
              (author-name-include? b word))]
  :rules [[(title-include? book word)
           [b :title title]
           (or [(str/includes? title word)]
               [(str/includes? (str/lower-case title) word)])]
          [(author-name-include? book word)
           [ba :label :book/book-author]
           [ba :author-id a]
           [ba :book-id b]
           [a :name name]
           (or [(str/includes? name word)]
               [(str/includes? (str/lower-case name) word)])]]}
words)


관련 문서