                             :sync :boolean
                             :primary-key [:id]}))
 
-
-;; Elasticsearch
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;              Elasticsearch
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 (defn esCreateIndexDesafio [esconn]
   (esi/create esconn index-name :mappings mapping-types :settings {"number_of_shards" 1}))

(defn casDropTableTweet [casconn]
  (cql/use-keyspace casconn keyspace-name)
  (cql/drop-table casconn "tweet"))


(defn casDeleteKeyspaceDesafio [casconn]
  (cql/drop-keyspace casconn keyspace-name))

  (let [hits (casGetNotSyncTweets casconn)]
    (cas2es esconn casconn hits)))



;;; tests helpers

(defn resetDBs [esconn casconn]
  (esDeleteIndexDesafio esconn)
  (esCreateIndexDesafio esconn)
  (casDropTableTweet casconn)
  (casCreateTableTweet casconn))

(defn data10es3cas [esconn casconn]
  (resetDBs esconn casconn)
  (esPutRandomTweets esconn 10)
  (casPutRandomTweets casconn 3))

;; Enable command-line invocation
(defn -main [& args]
  (let [esconn (esr/connect "http://127.0.0.1:9200")
