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
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