]> gitweb @ CieloNegro.org - Rakka.git/blobdiff - Rakka/Storage/Types.hs
continue working on page search
[Rakka.git] / Rakka / Storage / Types.hs
index 8a1904171fa2817ee3a9cbdcee548cac6982586e..2944f287038ba81ee45389694bcfc8901ba73b56 100644 (file)
@@ -1,6 +1,8 @@
 module Rakka.Storage.Types
     ( Storage(..)
     , IndexReq(..)
+    , SearchResult(..)
+    , SnippetFragment(..)
     )
     where
 
@@ -19,5 +21,21 @@ data Storage
 
 
 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