Safe Haskell | None |
---|---|
Language | Haskell98 |
The query language.
Query
specifies the complete grammar.
Hunt.Query.Language.Parser provides a parser for plain text queries.
- data Query
- data BinOp
- data TextSearchType
- escapeChar :: Char
- notWordChar :: String
- optimize :: Query -> Query
- checkWith :: (Text -> Bool) -> Query -> Bool
- extractTerms :: Query -> [Text]
- printQuery :: Query -> Text
Query data types
The query language.
QWord TextSearchType Text | prefix search for a word |
QFullWord TextSearchType Text | search for a complete word |
QPhrase TextSearchType Text | Phrase search. |
QContext [Context] Query | Restrict a query to a list of contexts. |
QBinary BinOp Query Query | Combine two queries with a binary operation. |
QSeq BinOp [Query] | |
QBoost Weight Query | Weight for query. |
QRange Text Text | Range query. |
A binary operation.
data TextSearchType Source
The search opeation.
QCase | Case-sensitive search. |
QNoCase | Case-insensitive search. |
QFuzzy | Fuzzy search. See Hunt.Query.Fuzzy for details.
The query processor allows additional configuration with
|
escapeChar :: Char Source
The character an escape sequence starts with.
Characters that cannot occur in a word (and have to be escaped).
Optimizing
checkWith :: (Text -> Bool) -> Query -> Bool Source
Check if the query arguments comply with some custom predicate.
extractTerms :: Query -> [Text] Source
Returns a list of all terms in the query.
Pretty printing
printQuery :: Query -> Text Source
Renders a text representation of a Query.