From 696ae59570e81870976fb319ccccd998752cf162 Mon Sep 17 00:00:00 2001 From: Richard Newman Date: Thu, 4 Aug 2016 18:55:06 -0700 Subject: [PATCH] Example query hacking. --- src/datomish/exec_repl.cljc | 6 ++++-- src/datomish/query.cljc | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/datomish/exec_repl.cljc b/src/datomish/exec_repl.cljc index 01fe4a0d..cfe8b5ea 100644 --- a/src/datomish/exec_repl.cljc +++ b/src/datomish/exec_repl.cljc @@ -96,6 +96,8 @@ [?e :x ?v] #_[(> ?v 1000)]] {})))))) -(dq/parse '[:find ?entity ?name ?tx ?score +(dq/parse '[:find ?entity ?tx ?score :in $ ?search - :where [(fulltext $ :artist/name ?search) [[?entity ?name ?tx ?score]]]]) + :where [(foobar $ :artist/name ?search) [[?entity _ ?tx ?score]]]]) + +(honeysql.core/format {:select [:?foo] :from [:foo] :where [:match :foo.x "Bar"]}) diff --git a/src/datomish/query.cljc b/src/datomish/query.cljc index 2ce56533..ac7c13c3 100644 --- a/src/datomish/query.cljc +++ b/src/datomish/query.cljc @@ -134,7 +134,7 @@ (datomish.query/parse '[:find ?page :in $ ?latest :where [?page :page/url "http://example.com/"] - [?page :page/title ?title] + [(fulltext $ :page/title "Some title") [[?page ?title _ _]]] (or [?entity :page/likes ?page] [?entity :page/loves ?page])