]> gitweb @ CieloNegro.org - Rakka.git/blobdiff - Rakka/Storage/Types.hs
improvements related to page search
[Rakka.git] / Rakka / Storage / Types.hs
index c83e53e0cd3bf8663eba2883573eeda9f2775708..28184a676e574d54989cecc80af2301dbb95a5b2 100644 (file)
@@ -2,6 +2,7 @@ module Rakka.Storage.Types
     ( Storage(..)
     , IndexReq(..)
     , SearchResult(..)
+    , HitPage(..)
     , SnippetFragment(..)
     )
     where
@@ -23,14 +24,22 @@ 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
+      , hpSnippet  :: [SnippetFragment]
       }
     deriving (Show, Eq)