module Rakka.Storage.Types
( Storage(..)
, IndexReq(..)
+ , SearchResult(..)
+ , SnippetFragment(..)
)
where
data IndexReq
- = SyncIndex
- | SearchIndex !Condition !(TMVar [(PageName, RevNum)])
+ = RebuildIndex
+ | SyncIndex
+ | SearchIndex !Condition !(TMVar [SearchResult])
+
+
+data SearchResult
+ = SearchResult {
+ srPageName :: !PageName
+ , srPageRev :: !RevNum
+ , srSnippet :: [SnippetFragment]
+ }
+ deriving (Show, Eq)
+
+
+data SnippetFragment
+ = NormalText !String
+ | HighlightedWord !String
+ deriving (Show, Eq)
\ No newline at end of file