@@ -64,13 +64,14 @@ import Database.Bloodhound.Types
64-- >>> :set -XOverloadedStrings
64-- >>> :set -XOverloadedStrings
65-- >>> import Database.Bloodhound
65-- >>> import Database.Bloodhound
66-- >>> import Test.DocTest.Prop (assert)
66-- >>> import Test.DocTest.Prop (assert)
68−-- no trailing slashes in servers, library handles building the path.
69-- >>> let testServer = (Server "http://localhost:9200")
67-- >>> let testServer = (Server "http://localhost:9200")
70-- >>> let testIndex = IndexName "twitter"
68-- >>> let testIndex = IndexName "twitter"
71-- >>> let testMapping = MappingName "tweet"
69-- >>> let testMapping = MappingName "tweet"
72−-- defaultIndexSettings is exported by Database.Bloodhound as well
73-- >>> let defaultIndexSettings = IndexSettings (ShardCount 3) (ReplicaCount 2)
70-- >>> let defaultIndexSettings = IndexSettings (ShardCount 3) (ReplicaCount 2)
71+-- >>> _ <- deleteIndex testServer testIndex
73+-- no trailing slashes in servers, library handles building the path.
74+-- defaultIndexSettings is exported by Database.Bloodhound as well
75mkShardCount :: Int -> Maybe ShardCount
76mkShardCount :: Int -> Maybe ShardCount
76mkShardCount n
77mkShardCount n
@@ -124,10 +125,9 @@ getStatus (Server server) = do
125-- | createIndex will create an index given a 'Server',
126-- | createIndex will create an index given a 'Server',
126-- 'IndexSettings', and an 'IndexName'
127-- 'IndexSettings', and an 'IndexName'
128-- >>> response <- createIndex testServer defaultIndexSettings testIndex
128-- >>> response <- createIndex testServer defaultIndexSettings testIndex
129−-- >>> assert $ respIsTwoHunna response
129+-- >>> respIsTwoHunna response
130−-- >>> assert False
130+-- True
131createIndex :: Server -> IndexSettings -> IndexName -> IO Reply
131createIndex :: Server -> IndexSettings -> IndexName -> IO Reply
132createIndex (Server server) indexSettings (IndexName indexName) =
132createIndex (Server server) indexSettings (IndexName indexName) =
133 put url body
133 put url body