X-Git-Url: http://git.cielonegro.org/gitweb.cgi?a=blobdiff_plain;f=Rakka%2FStorage%2FTypes.hs;h=e9b848ba8cdab1527fba5db257c9ceed764288d5;hb=9c2fc861f3ed609ebb4d0f135aea38ca055bbea8;hp=06870e65d82529bb722b45d7d415ba24800322b0;hpb=e43bb104a7313dd696b8bb8aa3bafff94706a187;p=Rakka.git diff --git a/Rakka/Storage/Types.hs b/Rakka/Storage/Types.hs index 06870e6..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 @@ -21,4 +25,30 @@ data Storage data IndexReq = RebuildIndex | SyncIndex - | SearchIndex !Condition !(TMVar [(PageName, RevNum)]) + | 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