Created
April 3, 2013 18:17
-
-
Save boxxxie/5303742 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;rules examples | |
[[(findname ?person ?search) [(fulltext $ :person/firstname ?search) [[?person ?name]]]] | |
[(findname ?person ?search) [(fulltext $ :person/lastname ?search) [[?person ?name]]]]] | |
;;attempt at making some rule for searching for geohashs... | |
[[(findgeohash ?place ?search) | |
[(fulltext $ :coordinate/gehoash ?search) | |
[[?place ?name]]]]] | |
(defn pythagorean [a b c] (= (+ (* a a) (* b b)) (* c c))) | |
(defn within-radius [radius ?coord] | |
(let [ ] | |
(< radius (distance | |
) | |
(q '[:find ?places | |
:in $ $lat $long $radius | |
:where | |
[(fulltext :coordinate/gehoash (geohash-partial lat long)] | |
[?places :place/geometry ?coords] | |
[?coords :geometry/coordinate ?coord] | |
[(within-radius $lat $long $radius ?coord)]] | |
db lat long radius) | |
;;may be able to use d/filter function in this senario... | |
;;https://github.com/Datomic/day-of-datomic/blob/master/tutorial/filter.clj |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
i really need to test this with clojure. (just wrote this up)