X-Git-Url: https://git.cielonegro.org/gitweb.cgi?a=blobdiff_plain;f=Rakka%2FStorage%2FTypes.hs;h=e9b848ba8cdab1527fba5db257c9ceed764288d5;hb=4abf7df08bf0a614ea8179e8d1d69a17aac4f197;hp=c83e53e0cd3bf8663eba2883573eeda9f2775708;hpb=529f792d338c75910079903e143d4dd21bd806c3;p=Rakka.git diff --git a/Rakka/Storage/Types.hs b/Rakka/Storage/Types.hs index c83e53e..e9b848b 100644 --- a/Rakka/Storage/Types.hs +++ b/Rakka/Storage/Types.hs @@ -2,11 +2,13 @@ module Rakka.Storage.Types ( Storage(..) , IndexReq(..) , SearchResult(..) + , HitPage(..) , SnippetFragment(..) ) where import Control.Concurrent.STM +import Data.Time import Rakka.Page import Subversion.Repository import Subversion.Types @@ -23,14 +25,24 @@ data Storage data IndexReq = RebuildIndex | SyncIndex - | SearchIndex !Condition !(TMVar [SearchResult]) + | SearchIndex !Condition !(TMVar SearchResult) data SearchResult = SearchResult { - srPageName :: !PageName - , srPageRev :: !RevNum - , srSnippet :: [SnippetFragment] + srTotal :: !Int + , srPages :: ![HitPage] + } + deriving (Show, Eq) + + +data HitPage + = HitPage { + hpPageName :: !PageName + , hpPageRev :: RevNum + , hpLastMod :: UTCTime + , hpSummary :: Maybe String + , hpSnippet :: [SnippetFragment] } deriving (Show, Eq)