This is what I use. Perhaps you can adapt it to your needs.
(defn find-items "Full text search titles and descriptions for [search-term]" [search-term] (let [keyys [:item-id :title :description] rules '[[(finditem ?item ?term) [(fulltext $ :item/title ?term) [[?item ?name]]]] [(finditem ?item ?term) [(fulltext $ :item/description ?term) [[?item ?name]]]]] items (d/q '[:find ?item ?title ?description :in $ ?term % :where (finditem ?item ?term) [?item :item/title ?title] [?item :item/description ?description]] (d/db db/CONN) search-term rules)] (map
The rules are used here, which you can read here: http://docs.datomic.com/query.html . The rules work as a pretty good equivalent to SQL OR , which is how I look for a needle in two haystacks in the above example.
source share