This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-01-13
Channels
- # beginners (99)
- # boot (2)
- # boot-dev (4)
- # chestnut (2)
- # cider (75)
- # clara (43)
- # cljs-dev (1)
- # cljsjs (6)
- # cljsrn (4)
- # clojars (2)
- # clojure (76)
- # clojure-brasil (1)
- # clojure-france (1)
- # clojure-italy (2)
- # clojure-spec (30)
- # clojure-uk (4)
- # clojurescript (39)
- # core-async (1)
- # core-logic (2)
- # cursive (1)
- # data-science (7)
- # datomic (14)
- # docker (12)
- # emacs (6)
- # fulcro (69)
- # garden (4)
- # hoplon (7)
- # jobs-discuss (46)
- # leiningen (3)
- # lumo (3)
- # off-topic (12)
- # om (2)
- # parinfer (12)
- # perun (9)
- # re-frame (44)
- # reagent (6)
- # rum (1)
- # shadow-cljs (73)
- # specter (5)
- # unrepl (10)
- # vim (2)
Can someone help me understand why
(def schema {:cli {:db/cardinality :db.cardinality/many}})
(d/transact! conn [{:name "foo" :type :cli} {:name "bar" :type :cli}])
(d/q '[:find (pull ?e [:name])
:where
[?e :type :cli]]
@conn)
;;([{:name "bar"}] [{:name "foo"}])
Returns a list of vectors rather then a list of maps? e.g
({:name "bar"} {:name "foo"})
@U0DJ4T5U1 By default, Datalog always returns a collection of tuples. If you want a list instead, wrap your pull pattern in [ ...]
; if you want a single result, add a .
after the pull pattern.
Thanks @U06GS6P1N. Thats right on point, with what i wanted. There are a lot of docs to comb over for datomic
@U0DJ4T5U1 You're welcome. What does 'comb over' mean in English?
@U06GS6P1N "comb over" in this context is like to search through, to read through. I think the best and most hilarious way to understand is by watching this clip from Spaceballs: https://www.youtube.com/watch?v=hD5eqBDPMDg
I’m trying out the fulltext in datomic and it looks like it only matches whole words?
like if I search “White” then a result like “Sam White” will return
but if I search “Whit” Than “Sam White” does not return. Am I doing something wrong?
Can I get datomic to return results that are parts of words?
@U3XCG2GBZ may be related: https://groups.google.com/forum/#!msg/datomic/8yrCYxcQq34/GIomGaarX5QJ
I generally agree with what Stuart Halloway said in this post - if you want powerful search, just send the data to a specialized store like ElasticSearch, with Datomic this is unusually easy to do thanks to facilities like the Log API and tx report queue.
I've done this with elasticsearch in the past and it's a breeze - but don't forget that your elasticsearch queries are likely to be an order of magnitude slower than your datomic ones, because your app doesn't have the elasticsearch data in memory.
Thanks guys. In the end I created a predicated that concatenated all the fields I wanted to search on and used a regex.