X-Git-Url: https://git.cielonegro.org/gitweb.cgi?a=blobdiff_plain;f=Rakka%2FStorage%2FTypes.hs;h=e9b848ba8cdab1527fba5db257c9ceed764288d5;hb=0cabe942a990a721bb8464354f96d51b107f00ad;hp=8a1904171fa2817ee3a9cbdcee548cac6982586e;hpb=126e9f3faff19add1fb3dea792ec10dc57c30f03;p=Rakka.git diff --git a/Rakka/Storage/Types.hs b/Rakka/Storage/Types.hs index 8a19041..e9b848b 100644 --- a/Rakka/Storage/Types.hs +++ b/Rakka/Storage/Types.hs @@ -1,10 +1,14 @@ 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 @@ -19,5 +23,32 @@ data Storage data IndexReq - = SyncIndex - | SearchIndex !Condition !(TMVar [(PageName, RevNum)]) + = RebuildIndex + | SyncIndex + | SearchIndex !Condition !(TMVar SearchResult) + + +data SearchResult + = SearchResult { + srTotal :: !Int + , srPages :: ![HitPage] + } + deriving (Show, Eq) + + +data HitPage + = HitPage { + hpPageName :: !PageName + , hpPageRev :: RevNum + , hpLastMod :: UTCTime + , hpSummary :: Maybe String + , hpSnippet :: [SnippetFragment] + } + deriving (Show, Eq) + + +data SnippetFragment + = Boundary + | NormalText !String + | HighlightedWord !String + deriving (Show, Eq) \ No newline at end of file