   (str (server-url) "/" (index-name)))
 
 (defn bulk-api-url
-  "Returns the url to bulk api"
+  "Returns the url to the bulk api"
   []
   (str (url) "/"
        (strip "/" (get-in config [:search :ubid-index-type])) "/_bulk"))

   (es/search api-url query (get-in config [:search :max-result-size]))))

(defn result
  "Returns sequence of tile-specs from search results"
  [search-results]
  (map #(get % "_source")
       (get-in search-results ["hits" "hits"])))

(defn save
  "Create index entry(s) in ES"
  [tile-specs]
  (log/debugf "creating index entry(s) for %s" tile-specs)
  (es/load! (bulk-api-url)

(ns lcmap.aardvark.tile-spec-index
  "Search index for tile-specs"
  (:require [lcmap.aardvark.config :refer [config]]
            [lcmap.aardvark.es :as es]
            [lcmap.aardvark.tile-spec :as tile-spec]
