xapianStore db PostSuccess{..} = do
    doc <- newDoc
    encVal doc siteIDSlot siteID
    encVal doc scoreSlot score
    encVal doc uploadedSlot $ utcTimeToPOSIXSeconds uploaded
    strVal doc fileNameSlot fileName
    strVal doc fileURLSlot  fileURL
    forM_ source $ strVal doc sourceSlot

    addTag db doc booruPrefix    $ T.pack postSite
    addTag db doc siteIDPrefix   $ T.pack (show siteID)
    addTag db doc uploaderPrefix $ T.pack (show uploader ++ "@" ++ postSite)
    addTag db doc ratingPrefix   $ T.pack (show rating)
    addTag db doc filePrefix     $ fileName
    addTag db doc extPrefix      $ getExt fileName
    forM_ tags $ addTag db doc tagPrefix

    void $ addDocument db doc
xapianStore db PostSuccess{..} = do
    doc <- newDoc
    encVal doc siteIDSlot siteID
    encVal doc scoreSlot score
    encVal doc uploadedSlot $ utcTimeToPOSIXSeconds uploaded
    strVal doc fileNameSlot fileName
    strVal doc fileURLSlot  fileURL
    forM_ source $ strVal doc sourceSlot

    addTag db doc booruPrefix    $ T.pack postSite
    addTag db doc siteIDPrefix   $ T.pack (show siteID)
    addTag db doc uploaderPrefix $ T.pack (show uploader ++ "@" ++ postSite)
    addTag db doc ratingPrefix   $ T.pack (show rating)
    addTag db doc filePrefix     $ fileName
    addTag db doc extPrefix      $ getExt fileName
    forM_ tags $ addTag db doc tagPrefix

    void $ addDocument db doc
xapianStore db PostSuccess{..} = do
    doc <- newDoc
    encVal doc siteIDSlot siteID
    encVal doc scoreSlot score
    encVal doc uploadedSlot $ utcTimeToPOSIXSeconds uploaded
    strVal doc fileNameSlot fileName
    strVal doc fileURLSlot  fileURL
    forM_ source $ strVal doc sourceSlot

    addTag db doc booruPrefix    $ T.pack postSite
    addTag db doc siteIDPrefix   $ T.pack (show siteID)
    addTag db doc uploaderPrefix $ T.pack (show uploader ++ "@" ++ postSite)
    addTag db doc ratingPrefix   $ T.pack (show rating)
    addTag db doc filePrefix     $ fileName
    addTag db doc extPrefix      $ getExt fileName
    forM_ tags $ addTag db doc tagPrefix

    void $ addDocument db doc