]> gitweb @ CieloNegro.org - Rakka.git/blobdiff - Rakka/Storage/Types.hs
continue working on page search
[Rakka.git] / Rakka / Storage / Types.hs
index 06870e65d82529bb722b45d7d415ba24800322b0..2944f287038ba81ee45389694bcfc8901ba73b56 100644 (file)
@@ -1,6 +1,8 @@
 module Rakka.Storage.Types
     ( Storage(..)
     , IndexReq(..)
+    , SearchResult(..)
+    , SnippetFragment(..)
     )
     where
 
@@ -21,4 +23,19 @@ data Storage
 data IndexReq
     = RebuildIndex
     | SyncIndex
-    | SearchIndex !Condition !(TMVar [(PageName, RevNum)])
+    | 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