-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Haskell bindings to the Sphinx full-text searching daemon. -- -- Haskell bindings to the Sphinx full-text searching daemon. Compatible -- with Sphinx version 2.0 @package sphinx @version 0.6.1 module Text.Search.Sphinx.ExcerptConfiguration data ExcerptConfiguration ExcerptConfiguration :: String -> Int -> String -> String -> String -> String -> Int -> Int -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Int -> Int -> Int -> Bool -> String -> Bool -> String -> ExcerptConfiguration -- | The hostname of the Sphinx daemon [host] :: ExcerptConfiguration -> String -- | The portnumber of the Sphinx daemon [port] :: ExcerptConfiguration -> Int -- | Encoding used to encode queries to the server, and decode server -- responses [encoding] :: ExcerptConfiguration -> String [beforeMatch] :: ExcerptConfiguration -> String [afterMatch] :: ExcerptConfiguration -> String [chunkSeparator] :: ExcerptConfiguration -> String [limit] :: ExcerptConfiguration -> Int [around] :: ExcerptConfiguration -> Int [exactPhrase] :: ExcerptConfiguration -> Bool [singlePassage] :: ExcerptConfiguration -> Bool [useBoundaries] :: ExcerptConfiguration -> Bool [weightOrder] :: ExcerptConfiguration -> Bool -- | warning! broken on 1.10-beta (keep to default of false). Fixed on -- trunk [queryMode] :: ExcerptConfiguration -> Bool [forceAllWords] :: ExcerptConfiguration -> Bool [limitPassages] :: ExcerptConfiguration -> Int [limitWords] :: ExcerptConfiguration -> Int [startPassageId] :: ExcerptConfiguration -> Int [loadFiles] :: ExcerptConfiguration -> Bool [htmlStripMode] :: ExcerptConfiguration -> String [allowEmpty] :: ExcerptConfiguration -> Bool [passageBoundary] :: ExcerptConfiguration -> String defaultConfig :: ExcerptConfiguration altConfig :: ExcerptConfiguration instance GHC.Show.Show Text.Search.Sphinx.ExcerptConfiguration.ExcerptConfiguration module Text.Search.Sphinx.Types -- | a result returned from searchd data Result a Ok :: a -> Result a Warning :: Text -> a -> Result a Error :: Int -> Text -> Result a Retry :: Text -> Result a data Match Match :: Int64 -> Int -> [Attr] -> Match [documentId] :: Match -> Int64 [documentWeight] :: Match -> Int [attributeValues] :: Match -> [Attr] data Attr AttrMulti :: [Attr] -> Attr AttrUInt :: Int -> Attr AttrBigInt :: Int64 -> Attr AttrString :: Text -> Attr AttrFloat :: Float -> Attr -- | Data structure representing one query. It can be sent with -- runQueries or runQueries' to the server in batch -- mode. data Query Query :: Text -> Text -> Text -> Query -- | The actual query string [queryString] :: Query -> Text -- | The indexes, "*" means every index [queryIndexes] :: Query -> Text -- | A comment string. [queryComment] :: Query -> Text -- | Current client-side command implementation versions data VerCommand VcSearch :: VerCommand VcExcerpt :: VerCommand VcUpdate :: VerCommand VcKeywords :: VerCommand -- | Search commands data SearchdCommand ScSearch :: SearchdCommand ScExcerpt :: SearchdCommand ScUpdate :: SearchdCommand ScKeywords :: SearchdCommand -- | Filter types data Filter ExclusionFilter :: Filter -> Filter FilterValues :: String -> [Int64] -> Filter FilterRange :: String -> Int64 -> Int64 -> Filter FilterFloatRange :: String -> Float -> Float -> Filter -- | status from an individual query data QueryStatus QueryOK :: QueryStatus QueryWARNING :: QueryStatus QueryERROR :: Int -> QueryStatus -- | Searchd status codes data Status OK :: Status RETRY :: Status WARNING :: Status ERROR :: Int -> Status -- | a single query result, runQueries returns a list of these data SingleResult QueryOk :: QueryResult -> SingleResult QueryWarning :: Text -> QueryResult -> SingleResult QueryError :: Int -> Text -> SingleResult -- | The result of a query data QueryResult QueryResult :: [Match] -> Int -> Int -> [(Text, Int, Int)] -> [ByteString] -> QueryResult -- | The matches [matches] :: QueryResult -> [Match] -- | Total amount of matches retrieved on server by this query. [total] :: QueryResult -> Int -- | Total amount of matching documents in index. [totalFound] :: QueryResult -> Int -- | processed words with the number of docs and the number of hits. [words] :: QueryResult -> [(Text, Int, Int)] -- | List of attribute names returned in the result. | The Match will -- contain just the attribute values in the same order. [attributeNames] :: QueryResult -> [ByteString] -- | Ranking modes (ext2 only) data Rank ProximityBm25 :: Rank Bm25 :: Rank None :: Rank WordCount :: Rank Proximity :: Rank MatchAny :: Rank Fieldmask :: Rank Sph04 :: Rank RankExpr :: Rank Total :: Rank -- | Match modes data MatchMode All :: MatchMode Any :: MatchMode Phrase :: MatchMode Boolean :: MatchMode Extended :: MatchMode Fullscan :: MatchMode Extended2 :: MatchMode -- | Sort modes data Sort Relevance :: Sort AttrDesc :: Sort AttrAsc :: Sort TimeSegments :: Sort SortExtended :: Sort Expr :: Sort -- | Attribute types data AttrT AttrTUInt :: AttrT AttrTTimestamp :: AttrT AttrTStr2Ordinal :: AttrT AttrTBool :: AttrT AttrTFloat :: AttrT AttrTBigInt :: AttrT AttrTString :: AttrT AttrTWordCount :: AttrT AttrTMulti :: AttrT -> AttrT -- | Grouping functions data GroupByFunction Day :: GroupByFunction Week :: GroupByFunction Month :: GroupByFunction Year :: GroupByFunction Attr :: GroupByFunction AttrPair :: GroupByFunction fromEnumFilter :: Num a => Filter -> a toStatus :: Int -> Status searchdCommand :: SearchdCommand -> Int -- | Important! 2.0 compatible verCommand :: Num a => VerCommand -> a toQueryStatus :: Int -> QueryStatus -- | shortcut for creating an exclusion filter exclude :: Filter -> Filter toAttrT :: (Eq a, Num a) => a -> AttrT attrT :: Num a => AttrT -> a attrMultiMask :: Integer -- | A space-efficient representation of a Word8 vector, supporting -- many efficient operations. -- -- A lazy ByteString contains 8-bit bytes, or by using the -- operations from Data.ByteString.Lazy.Char8 it can be -- interpreted as containing 8-bit characters. data () => ByteString instance GHC.Show.Show Text.Search.Sphinx.Types.Query instance GHC.Enum.Enum Text.Search.Sphinx.Types.SearchdCommand instance GHC.Show.Show Text.Search.Sphinx.Types.SearchdCommand instance GHC.Show.Show Text.Search.Sphinx.Types.VerCommand instance GHC.Show.Show Text.Search.Sphinx.Types.Status instance GHC.Show.Show Text.Search.Sphinx.Types.QueryStatus instance GHC.Enum.Enum Text.Search.Sphinx.Types.MatchMode instance GHC.Show.Show Text.Search.Sphinx.Types.MatchMode instance GHC.Enum.Enum Text.Search.Sphinx.Types.Rank instance GHC.Show.Show Text.Search.Sphinx.Types.Rank instance GHC.Enum.Enum Text.Search.Sphinx.Types.Sort instance GHC.Show.Show Text.Search.Sphinx.Types.Sort instance GHC.Show.Show Text.Search.Sphinx.Types.Filter instance GHC.Show.Show Text.Search.Sphinx.Types.AttrT instance GHC.Enum.Enum Text.Search.Sphinx.Types.GroupByFunction instance GHC.Show.Show Text.Search.Sphinx.Types.GroupByFunction instance GHC.Show.Show a => GHC.Show.Show (Text.Search.Sphinx.Types.Result a) instance GHC.Show.Show Text.Search.Sphinx.Types.Attr instance GHC.Show.Show Text.Search.Sphinx.Types.Match instance GHC.Show.Show Text.Search.Sphinx.Types.QueryResult instance GHC.Show.Show Text.Search.Sphinx.Types.SingleResult instance GHC.Classes.Eq Text.Search.Sphinx.Types.Match instance GHC.Enum.Enum Text.Search.Sphinx.Types.AttrT module Text.Search.Sphinx.Indexable data SchemaType TField :: SchemaType TAttribute :: AttrT -> SchemaType TFieldString :: SchemaType type Id = Int class SphinxSchema a -- | Convert a value of a to a document with a document id and some -- attributes and fields. toDocument :: SphinxSchema a => a -> (Id, [(String, Attr)]) -- | The first parameter should be ignored, but is used to satisfy -- Haskell's type system. schema :: SphinxSchema a => a -> [(String, SchemaType)] serialize :: SphinxSchema a => [a] -> Element module Text.Search.Sphinx.Configuration -- | The configuration for a query -- -- A note about encodings: The encoding specified here is used to encode -- every Text value that is sent to the server, and it used to -- decode all of the server's answers, including error messages. -- -- If the specified encoding doesn't support characters sent to the -- server, they will silently be substituted with the byte value of -- '\SUB' :: Char before transmission. -- -- If the server sends a byte value back that the encoding doesn't -- understand, the affected bytes will be converted into special values -- as specified by that encoding. For example, when decoding invalid -- UTF-8, all invalid bytes are going to be substituted with '\65533' -- :: Char. data Configuration Configuration :: String -> Int -> String -> [Int] -> Int -> Int -> MatchMode -> Rank -> String -> Sort -> String -> Int -> Int -> [Filter] -> String -> String -> GroupByFunction -> String -> Int -> Int -> Int -> Int -> [(String, Int)] -> Int -> [(String, Int)] -> String -> Configuration -- | The hostname of the Sphinx daemon [host] :: Configuration -> String -- | The portnumber of the Sphinx daemon [port] :: Configuration -> Int -- | Encoding used to encode queries to the server, and decode server -- responses [encoding] :: Configuration -> String -- | Per-field weights [weights] :: Configuration -> [Int] -- | How many records to seek from result-set start (default is 0) [offset] :: Configuration -> Int -- | How many records to return from result-set starting at offset (default -- is 20) [limit] :: Configuration -> Int -- | Query matching mode [mode] :: Configuration -> MatchMode -- | Ranking mode [ranker] :: Configuration -> Rank -- | Ranking expression, used when ranker = RankExpr [rankExpr] :: Configuration -> String -- | Match sorting mode [sort] :: Configuration -> Sort -- | Attribute to sort by [sortBy] :: Configuration -> String -- | Minimum ID to match, 0 means no limit [minId] :: Configuration -> Int -- | Maximum ID to match, 0 means no limit [maxId] :: Configuration -> Int -- | attribute filters [filters] :: Configuration -> [Filter] -- | Group-by sorting clause (to sort groups in result set with) [groupBy] :: Configuration -> String -- | Group-by count-distinct attribute [groupSort] :: Configuration -> String -- | Group-by function (to pre-process group-by attribute value with) [groupByFunc] :: Configuration -> GroupByFunction -- | Group-by attribute name [groupDistinct] :: Configuration -> String -- | Maximum number of matches to retrieve [maxMatches] :: Configuration -> Int -- | Cutoff to stop searching at [cutoff] :: Configuration -> Int -- | Distributed retries count [retryCount] :: Configuration -> Int -- | Distributed retries delay [retryDelay] :: Configuration -> Int -- | Per-index weights [indexWeights] :: Configuration -> [(String, Int)] -- | Maximum query time in milliseconds, 0 means no limit [maxQueryTime] :: Configuration -> Int -- | Per-field-name weights [fieldWeights] :: Configuration -> [(String, Int)] -- | attributes to select, defaults to "*" [selectClause] :: Configuration -> String -- | A basic, default configuration. defaultConfig :: Configuration instance GHC.Show.Show Text.Search.Sphinx.Configuration.Configuration module Text.Search.Sphinx -- | Escape all possible meta characters. Most of these characters only -- need to be escaped in certain contexts however, in normal searching -- they will all be ignored escapeText :: Text -> Text -- | The query function runs a single query against the Sphinx -- daemon. To pipeline multiple queries in a batch, use and -- runQueries. query :: Configuration -> Text -> Text -> IO (Result QueryResult) -- | TODO: add configuration options buildExcerpts :: ExcerptConfiguration -> [Text] -> Text -> Text -> IO (Result [Text]) -- | Make multiple queries at once, using a list of Query. For a -- single query, just use the query method Easier handling of query -- result than runQueries' runQueries :: Configuration -> [Query] -> IO (Result [QueryResult]) -- | Lower level- called by runQueries. This may be useful for -- debugging problems- warning messages won't get compressed runQueries' :: Configuration -> [Query] -> IO (Result [SingleResult]) -- | Combine results from runQueries into matches. resultsToMatches :: Int -> [QueryResult] -> [Match] -- | executes runQueries. Log warning and errors, automatically -- retry. Return a Nothing on error, otherwise a Just. maybeQueries :: (Text -> IO ()) -> Configuration -> [Query] -> IO (Maybe [QueryResult]) -- | Data structure representing one query. It can be sent with -- runQueries or runQueries' to the server in batch -- mode. data Query Query :: Text -> Text -> Text -> Query -- | The actual query string [queryString] :: Query -> Text -- | The indexes, "*" means every index [queryIndexes] :: Query -> Text -- | A comment string. [queryComment] :: Query -> Text -- | This is a convenience function which accepts a search string and -- builds a query for that string over all indexes without attaching -- comments to the queries. simpleQuery :: Text -> Query -- | The configuration for a query -- -- A note about encodings: The encoding specified here is used to encode -- every Text value that is sent to the server, and it used to -- decode all of the server's answers, including error messages. -- -- If the specified encoding doesn't support characters sent to the -- server, they will silently be substituted with the byte value of -- '\SUB' :: Char before transmission. -- -- If the server sends a byte value back that the encoding doesn't -- understand, the affected bytes will be converted into special values -- as specified by that encoding. For example, when decoding invalid -- UTF-8, all invalid bytes are going to be substituted with '\65533' -- :: Char. data Configuration Configuration :: String -> Int -> String -> [Int] -> Int -> Int -> MatchMode -> Rank -> String -> Sort -> String -> Int -> Int -> [Filter] -> String -> String -> GroupByFunction -> String -> Int -> Int -> Int -> Int -> [(String, Int)] -> Int -> [(String, Int)] -> String -> Configuration -- | The hostname of the Sphinx daemon [host] :: Configuration -> String -- | The portnumber of the Sphinx daemon [port] :: Configuration -> Int -- | Encoding used to encode queries to the server, and decode server -- responses [encoding] :: Configuration -> String -- | Per-field weights [weights] :: Configuration -> [Int] -- | How many records to seek from result-set start (default is 0) [offset] :: Configuration -> Int -- | How many records to return from result-set starting at offset (default -- is 20) [limit] :: Configuration -> Int -- | Query matching mode [mode] :: Configuration -> MatchMode -- | Ranking mode [ranker] :: Configuration -> Rank -- | Ranking expression, used when ranker = RankExpr [rankExpr] :: Configuration -> String -- | Match sorting mode [sort] :: Configuration -> Sort -- | Attribute to sort by [sortBy] :: Configuration -> String -- | Minimum ID to match, 0 means no limit [minId] :: Configuration -> Int -- | Maximum ID to match, 0 means no limit [maxId] :: Configuration -> Int -- | attribute filters [filters] :: Configuration -> [Filter] -- | Group-by sorting clause (to sort groups in result set with) [groupBy] :: Configuration -> String -- | Group-by count-distinct attribute [groupSort] :: Configuration -> String -- | Group-by function (to pre-process group-by attribute value with) [groupByFunc] :: Configuration -> GroupByFunction -- | Group-by attribute name [groupDistinct] :: Configuration -> String -- | Maximum number of matches to retrieve [maxMatches] :: Configuration -> Int -- | Cutoff to stop searching at [cutoff] :: Configuration -> Int -- | Distributed retries count [retryCount] :: Configuration -> Int -- | Distributed retries delay [retryDelay] :: Configuration -> Int -- | Per-index weights [indexWeights] :: Configuration -> [(String, Int)] -- | Maximum query time in milliseconds, 0 means no limit [maxQueryTime] :: Configuration -> Int -- | Per-field-name weights [fieldWeights] :: Configuration -> [(String, Int)] -- | attributes to select, defaults to "*" [selectClause] :: Configuration -> String -- | A basic, default configuration. defaultConfig :: Configuration