git.iko.soy/typeable/bloodhound
on master help sign in
add function for deleting alias
commitdc1e45017b67db9d686be26ae5ec0c5994a365ea authorAndrew Martin <andrew.thaddeus@gmail.com> dateWed 31 May 2017, 16:06 (9 years ago) parent79b4f90
1 file changed+7
src/Database/V5/Bloodhound/Client.hs+7
src/Database/V5/Bloodhound/Client.hs+7
@@ -37,6 +37,7 @@ module Database.V5.Bloodhound.Client
3737 -- *** Index Aliases
3838 , updateIndexAliases
3939 , getIndexAliases
40+ , deleteIndexAlias
4041 -- *** Index Templates
4142 , putTemplate
4243 , templateExists
@@ -710,6 +711,12 @@ getIndexAliases :: (MonadBH m, MonadThrow m)
710711getIndexAliases = parseEsResponse =<< get =<< url
711712 where url = joinPath ["_aliases"]
712713
714+-- | Delete a single alias, removing it from all indices it
715+-- is currently associated with.
716+deleteIndexAlias :: MonadBH m => IndexAliasName -> m Reply
717+deleteIndexAlias (IndexAliasName (IndexName name)) = delete =<< url
718+ where url = joinPath ["_all","_alias",name]
719+
713720-- | 'putTemplate' creates a template given an 'IndexTemplate' and a 'TemplateName'.
714721-- Explained in further detail at
715722-- <https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-templates.html>