mirror of
https://github.com/typeable/bloodhound.git
synced 2024-11-25 14:40:20 +03:00
Index flushing, echo silence
This commit is contained in:
parent
2ddaedd05e
commit
5c7caa6f81
2
Makefile
2
Makefile
@ -38,7 +38,7 @@ mod-build:
|
||||
stack build --ghc-options '+RTS -A128M -RTS'
|
||||
|
||||
echo-warn:
|
||||
echo "Make certain you have an elasticsearch instance on localhost:9200 !"
|
||||
@echo "Make certain you have an elasticsearch instance on localhost:9200 !"
|
||||
|
||||
7.8-build:
|
||||
STACK_YAML="stack-7.8.yaml" stack build
|
||||
|
@ -26,6 +26,7 @@ module Database.V5.Bloodhound.Client
|
||||
-- ** Indices
|
||||
, createIndex
|
||||
, createIndexWith
|
||||
, flushIndex
|
||||
, deleteIndex
|
||||
, updateIndexSettings
|
||||
, getIndexSettings
|
||||
@ -534,7 +535,13 @@ createIndexWith updates shards (IndexName indexName) =
|
||||
)
|
||||
]
|
||||
|
||||
-- | 'deleteIndex' will delete an index given a 'Server', and an 'IndexName'.
|
||||
-- | 'flushIndex' will flush an index given a 'Server' and an 'IndexName'.
|
||||
flushIndex :: MonadBH m => IndexName -> m Reply
|
||||
flushIndex (IndexName indexName) = do
|
||||
path <- joinPath [indexName, "_flush"]
|
||||
post path Nothing
|
||||
|
||||
-- | 'deleteIndex' will delete an index given a 'Server' and an 'IndexName'.
|
||||
--
|
||||
-- >>> _ <- runBH' $ createIndex defaultIndexSettings (IndexName "didimakeanindex")
|
||||
-- >>> response <- runBH' $ deleteIndex (IndexName "didimakeanindex")
|
||||
|
@ -164,3 +164,10 @@ spec = do
|
||||
_ <- createExampleIndex
|
||||
resp <- forceMergeIndex (IndexList (testIndex :| [])) defaultForceMergeIndexSettings
|
||||
liftIO $ validateStatus resp 200
|
||||
|
||||
|
||||
describe "Index flushing" $ do
|
||||
it "returns a successful response upon flushing" $ withTestEnv $ do
|
||||
_ <- createExampleIndex
|
||||
resp <- flushIndex testIndex
|
||||
liftIO $ validateStatus resp 200
|
||||
|
Loading…
Reference in New Issue
Block a user