     (def topType (. (. @database getTypeSystem) getTop))
     (def userThreadRelType (HGQuery$hg/assertAtom @database (HGRelType. "user-thread" (into-array HGHandle [topType topType]))))
     ;(def userPostRelType (HGQuery$hg/assertAtom @database (HGRelType. "user-post" (into-array HGHandle [topType topType]))))
+
+    ;(def postTypeHandle (. (. @database getTypeSystem) getTypeHandle Post))
+    ;(. (. @database getIndexManager) register (ByPartIndexer. postTypeHandle, "content"))
+    ;(. @database runMaintenance)
 
     (if (= database-exists 0)
       (do

           (org.joda.time DateTime)
           (org.hypergraphdb.atom HGRel HGRelType)
           (org.hypergraphdb.query HGQueryCondition AtomPartRegExPredicate)
           (java.util.regex Pattern))
  (:require [clojure.string :as string]
            [clojure.xml :as xml]
            [clj-time.format :as f]

  Creates a database or opens existing one from the folder specified by argument
  "
  [path]
  (def config (HGConfiguration.))
  (def handleFactory (SequentialUUIDHandleFactory. (System/currentTimeMillis) 0))
  (. config setHandleFactory handleFactory)
  (. config setTransactional false)
  (def storeConfig (. (. config getStoreImplementation) getConfiguration))
  (. (. storeConfig getEnvironmentConfig) setCacheSize (* (* 1024 1024) 500))
  (let [dbinstance (HGEnvironment/get path config)]
    (reset! database dbinstance)))

(defn close-database
