@@ -138,9 +138,12 @@ openIndex = openOrCloseIndexes OpenIndex
138138closeIndex :: Server -> IndexName -> IO Reply
139139closeIndex = openOrCloseIndexes CloseIndex
140140
141−createMapping :: ToJSON a => Server -> IndexName
141+{-| putMapping is an HTTP PUT and has upsert semantics. Mappings are schemas
142+ for documents in indexes.
143+-}
144+putMapping :: ToJSON a => Server -> IndexName
142145 -> MappingName -> a -> IO Reply
143−createMapping (Server server) (IndexName indexName) (MappingName mappingName) mapping =
146+putMapping (Server server) (IndexName indexName) (MappingName mappingName) mapping =
144147 put url body
145148 where url = joinPath [server, indexName, mappingName, "_mapping"]
146149 body = Just $ encode mapping
@@ -149,6 +152,7 @@ deleteMapping :: Server -> IndexName -> MappingName -> IO Reply
149152deleteMapping (Server server) (IndexName indexName)
150153 (MappingName mappingName) =
151154 delete $ joinPath [server, indexName, mappingName, "_mapping"]
155+
152156indexDocument :: ToJSON doc => Server -> IndexName -> MappingName
153157 -> doc -> DocId -> IO Reply
154158indexDocument (Server server) (IndexName indexName)