git.iko.soy/typeable/bloodhound
on master help sign in
more docs
commitcb9e3247896aa21034ecdfa143dfc537e63224f8 authorChris Allen <cma@bitemyapp.com> dateSat 10 May 2014, 20:36 (12 years ago) parente5a9884
1 file changed+10
Database/Bloodhound/Types.hs+10
Database/Bloodhound/Types.hs+10
@@ -314,6 +314,7 @@ newtype FieldName = FieldName Text deriving (Eq, Show)
314314{-| 'CacheName' is used in 'RegexpQuery' and 'RegexpFilter' for describing the
315315 'CacheKey' keyed caching behavior. -}
316316newtype CacheName = CacheName Text deriving (Eq, Show)
317+{-| 'CacheKey' is used in 'RegexpQuery' and 'RegexpFilter' to key regex caching behavior. -}
317318newtype CacheKey = CacheKey Text deriving (Eq, Show)
318319newtype Existence = Existence Bool deriving (Eq, Show)
319320newtype NullValue = NullValue Bool deriving (Eq, Show)
@@ -348,6 +349,7 @@ newtype PhraseSlop = PhraseSlop Int deriving (Eq, Show, Generic)
348349newtype MinDocFrequency = MinDocFrequency Int deriving (Eq, Show, Generic)
349350newtype MaxDocFrequency = MaxDocFrequency Int deriving (Eq, Show, Generic)
350351
352+{-| 'unpackId' is a silly convenience function that gets used once. -}
351353unpackId :: DocId -> String
352354unpackId (DocId docId) = docId
353355
@@ -569,6 +571,9 @@ data MatchQuery =
569571 , matchQueryMaxExpansions :: Maybe MaxExpansions
570572 , matchQueryLenient :: Maybe Lenient } deriving (Eq, Show)
571573
574+{-| 'mkMatchQuery' is a convenience function that defaults the less common parameters,
575+ enabling you to provide only the 'FieldName' and 'QueryString' to make a 'MatchQuery'
576+-}
572577mkMatchQuery :: FieldName -> QueryString -> MatchQuery
573578mkMatchQuery field query = MatchQuery field query Or ZeroTermsNone Nothing Nothing Nothing Nothing Nothing
574579
@@ -587,6 +592,11 @@ data MultiMatchQuery =
587592 , multiMatchQueryMaxExpansions :: Maybe MaxExpansions
588593 , multiMatchQueryLenient :: Maybe Lenient } deriving (Eq, Show)
589594
595+{-| 'mkMultiMatchQuery' is a convenience function that defaults the less common parameters,
596+ enabling you to provide only the list of 'FieldName's and 'QueryString' to
597+ make a 'MultiMatchQuery'.
598+-}
599+
590600mkMultiMatchQuery :: [FieldName] -> QueryString -> MultiMatchQuery
591601mkMultiMatchQuery matchFields query =
592602 MultiMatchQuery matchFields query Or ZeroTermsNone Nothing Nothing Nothing Nothing Nothing Nothing