( Storage(..)
, IndexReq(..)
, SearchResult(..)
+ , HitPage(..)
, SnippetFragment(..)
)
where
import Control.Concurrent.STM
+import Data.Time
import Rakka.Page
import Subversion.Repository
import Subversion.Types
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