storeElasticsearch :: (MonadBaseControl IO m, MonadThrow m, MonadIO m, MonadResource m)
                   => String -> String -> Manager -> m ()
storeElasticsearch url indexName mgr = do
    dpr   <- getDeprecateds mgr
    index <- parseUrl "http://hackage.haskell.org/packages/index.tar.gz"
    src   <- http index mgr
    req   <- parseUrl' url
    responseBody src $$+-
        ZLib.ungzip =$ untar =$ entryToPackageDescription index mgr =$
        sinkStoreElasticsearch 500 True dpr req { path = S.pack $ '/' : indexName ++ "/package/_bulk" } mgr
storeElasticsearch :: (MonadBaseControl IO m, MonadThrow m, MonadIO m, MonadResource m)
                   => String -> String -> Manager -> m ()
storeElasticsearch url indexName mgr = do
    dpr   <- getDeprecateds mgr
    index <- parseUrl "http://hackage.haskell.org/packages/index.tar.gz"
    src   <- http index mgr
    req   <- parseUrl' url
    responseBody src $$+-
        ZLib.ungzip =$ untar =$ entryToPackageDescription index mgr =$
        sinkStoreElasticsearch 500 True dpr req { path = S.pack $ '/' : indexName ++ "/package/_bulk" } mgr
storeElasticsearch url indexName mgr = do
    dpr   <- getDeprecateds mgr
    index <- parseUrl "http://hackage.haskell.org/packages/index.tar.gz"
    src   <- http index mgr
    req   <- parseUrl' url
    responseBody src $$+-
        ZLib.ungzip =$ untar =$ entryToPackageDescription index mgr =$
        sinkStoreElasticsearch 500 True dpr req { path = S.pack $ '/' : indexName ++ "/package/_bulk" } mgr