git.iko.soy/typeable/bloodhound
on master help sign in
Fixed mapping API
113aecdJohn Galt
src/Database/Bloodhound/Client.hs+2−2
@@ -312,7 +312,7 @@ putMapping :: (MonadBH m, ToJSON a) => IndexName
312 -> MappingName -> a -> m Reply
312 -> MappingName -> a -> m Reply
313putMapping (IndexName indexName) (MappingName mappingName) mapping =
313putMapping (IndexName indexName) (MappingName mappingName) mapping =
314 bindM2 put url (return body)
314 bindM2 put url (return body)
315− where url = joinPath [indexName, mappingName, "_mapping"]
315+ where url = joinPath [indexName, "_mapping", mappingName]
316 body = Just $ encode mapping
316 body = Just $ encode mapping
317
317
318-- | 'deleteMapping' is an HTTP DELETE and deletes a mapping for a given index.
318-- | 'deleteMapping' is an HTTP DELETE and deletes a mapping for a given index.
@@ -326,7 +326,7 @@ putMapping (IndexName indexName) (MappingName mappingName) mapping =
326deleteMapping :: MonadBH m => IndexName -> MappingName -> m Reply
326deleteMapping :: MonadBH m => IndexName -> MappingName -> m Reply
327deleteMapping (IndexName indexName)
327deleteMapping (IndexName indexName)
328 (MappingName mappingName) =
328 (MappingName mappingName) =
329− delete =<< joinPath [indexName, mappingName, "_mapping"]
329+ delete =<< joinPath [indexName, "_mapping", mappingName]
330
330
331-- | 'indexDocument' is the primary way to save a single document in
331-- | 'indexDocument' is the primary way to save a single document in
332-- Elasticsearch. The document itself is simply something we can
332-- Elasticsearch. The document itself is simply something we can