-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Haskell bindings to the Sphinx full-text searching deamon. -- -- Haskell bindings to the Sphinx full-text searching deamon. Compatible -- with Sphinx version 2.0 @package sphinx @version 0.5.2 module Text.Search.Sphinx.ExcerptConfiguration data ExcerptConfiguration ExcerptConfiguration :: String -> Int -> 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 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 instance Show ExcerptConfiguration module Text.Search.Sphinx.Types -- | Search commands data SearchdCommand ScSearch :: SearchdCommand ScExcerpt :: SearchdCommand ScUpdate :: SearchdCommand ScKeywords :: SearchdCommand searchdCommand :: SearchdCommand -> Int -- | Current client-side command implementation versions data VerCommand VcSearch :: VerCommand VcExcerpt :: VerCommand VcUpdate :: VerCommand VcKeywords :: VerCommand -- | Important! 2.0 compatible -- -- Searchd status codes data Status OK :: Status RETRY :: Status WARNING :: Status ERROR :: Int -> Status -- | status from an individual query data QueryStatus QueryOK :: QueryStatus QueryWARNING :: QueryStatus QueryERROR :: Int -> QueryStatus -- | Match modes data MatchMode All :: MatchMode Any :: MatchMode Phrase :: MatchMode Boolean :: MatchMode Extended :: MatchMode Fullscan :: MatchMode Extended2 :: MatchMode -- | Ranking modes (ext2 only) data Rank ProximityBm25 :: Rank Bm25 :: Rank None :: Rank WordCount :: Rank Proximity :: Rank MatchAny :: Rank Fieldmask :: Rank Sph04 :: Rank Total :: Rank -- | Sort modes data Sort Relevance :: Sort AttrDesc :: Sort AttrAsc :: Sort TimeSegments :: Sort SortExtended :: Sort Expr :: Sort -- | Filter types data Filter ExclusionFilter :: Filter -> Filter FilterValues :: String -> [Int64] -> Filter FilterRange :: String -> Int64 -> Int64 -> Filter -- | shortcut for creating an exclusion filter -- -- 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 -- | The result of a query data QueryResult QueryResult :: [Match] -> Int -> Int -> [(ByteString, 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 -> [(ByteString, 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] -- | a single query result, runQueries returns a list of these data SingleResult QueryOk :: QueryResult -> SingleResult QueryWarning :: ByteString -> QueryResult -> SingleResult QueryError :: Int -> ByteString -> SingleResult -- | a result returned from searchd data Result a Ok :: a -> Result a Warning :: ByteString -> a -> Result a Error :: Int -> ByteString -> Result a Retry :: ByteString -> 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 :: ByteString -> Attr AttrFloat :: Float -> Attr -- | A space-efficient representation of a Word8 vector, supporting many -- efficient operations. A ByteString contains 8-bit characters -- only. -- -- Instances of Eq, Ord, Read, Show, Data, Typeable data ByteString :: * instance Show SearchdCommand instance Enum SearchdCommand instance Show VerCommand instance Show Status instance Show QueryStatus instance Show MatchMode instance Enum MatchMode instance Show Rank instance Enum Rank instance Show Sort instance Enum Sort instance Show Filter instance Show AttrT instance Show GroupByFunction instance Enum GroupByFunction instance Show a => Show (Result a) instance Show Attr instance Show Match instance Show QueryResult instance Show SingleResult instance Enum AttrT module Text.Search.Sphinx.Configuration -- | The configuration for a query data Configuration Configuration :: String -> Int -> [Int] -> Int -> Int -> MatchMode -> Rank -> 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 -- | 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 -- | 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 instance Show Configuration module Text.Search.Sphinx.Indexable data SchemaType TField :: SchemaType TAttribute :: AttrT -> SchemaType TFieldString :: SchemaType type Id = Int class SphinxSchema a toDocument :: SphinxSchema a => a -> (Id, [(String, Attr)]) schema :: SphinxSchema a => a -> [(String, SchemaType)] serialize :: SphinxSchema a => [a] -> Element module Text.Search.Sphinx escapedChars :: String -- | 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 escapeString :: String -> String -- | The query function runs a single query against the Sphinx -- daemon. For Multiple query batches use addQuery and runQueries query :: Configuration -> String -> String -> IO (Result QueryResult) connect :: String -> Int -> IO Handle -- | TODO: add configuration options buildExcerpts :: ExcerptConfiguration -> [String] -> String -> String -> IO (Result [ByteString]) -- | use for multiple queries- for a single query, use the query method -- easier handling of query result than runQueries' runQueries :: Configuration -> [Put] -> IO (Result [QueryResult]) -- | lower level- called by runQueries | this may be useful for debugging -- problems- warning messages won't get compressed runQueries' :: Configuration -> [Put] -> IO (Result [SingleResult]) -- | TODO: hide this function getResponse :: Handle -> IO (Status, ByteString) -- | use with runQueries to run batched queries addQuery :: Configuration -> String -> String -> String -> Put -- | The configuration for a query data Configuration Configuration :: String -> Int -> [Int] -> Int -> Int -> MatchMode -> Rank -> 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 -- | 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 -- | 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 defaultConfig :: Configuration