X-Git-Url: http://git.cielonegro.org/gitweb.cgi?a=blobdiff_plain;f=Rakka%2FStorage%2FTypes.hs;h=e9b848ba8cdab1527fba5db257c9ceed764288d5;hb=4abf7df08bf0a614ea8179e8d1d69a17aac4f197;hp=2944f287038ba81ee45389694bcfc8901ba73b56;hpb=e751af5e3d23d7757f363bf4e86f9d732d90be7f;p=Rakka.git diff --git a/Rakka/Storage/Types.hs b/Rakka/Storage/Types.hs index 2944f28..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,19 +25,30 @@ 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) data SnippetFragment - = NormalText !String + = Boundary + | NormalText !String | HighlightedWord !String deriving (Show, Eq) \ No newline at end of file