- escapedChars :: String
- escapeString :: String -> String
- query :: Configuration -> String -> String -> IO (Result QueryResult)
- connect :: String -> Int -> IO Handle
- buildExcerpts :: ExcerptConfiguration -> [String] -> String -> String -> IO (Result [ByteString])
- runQueries :: Configuration -> [Put] -> IO (Result [QueryResult])
- runQueries' :: Configuration -> [Put] -> IO (Result [SingleResult])
- getResponse :: Handle -> IO (Status, ByteString)
- addQuery :: Configuration -> String -> String -> String -> Put
- data Configuration = Configuration {
- host :: String
- port :: Int
- weights :: [Int]
- offset :: Int
- limit :: Int
- mode :: MatchMode
- ranker :: Rank
- sort :: Sort
- sortBy :: String
- minId :: Int
- maxId :: Int
- filters :: [Filter]
- groupBy :: String
- groupSort :: String
- groupByFunc :: GroupByFunction
- groupDistinct :: String
- maxMatches :: Int
- cutoff :: Int
- retryCount :: Int
- retryDelay :: Int
- indexWeights :: [(String, Int)]
- maxQueryTime :: Int
- fieldWeights :: [(String, Int)]
- selectClause :: String
- defaultConfig :: Configuration
Documentation
escapeString :: String -> StringSource
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
:: Configuration | The configuration |
-> String | The indexes, * means every index |
-> String | The query string |
-> IO (Result QueryResult) | just one search result back |
The query
function runs a single query against the Sphinx daemon.
For Multiple query batches use addQuery and runQueries
:: ExcerptConfiguration | Contains host and port for connection and optional configuration for buildExcerpts |
-> [String] | list of document contents to be highlighted |
-> String | The indexes, * means every index |
-> String | The query string to use for excerpts |
-> IO (Result [ByteString]) | the documents with excerpts highlighted |
TODO: add configuration options
runQueries :: Configuration -> [Put] -> IO (Result [QueryResult])Source
use for multiple queries- for a single query, use the query method easier handling of query result than runQueries'
runQueries' :: Configuration -> [Put] -> IO (Result [SingleResult])Source
lower level- called by runQueries | this may be useful for debugging problems- warning messages won't get compressed
getResponse :: Handle -> IO (Status, ByteString)Source
TODO: hide this function
addQuery :: Configuration -> String -> String -> String -> PutSource
use with runQueries to run batched queries
data Configuration Source
The configuration for a query
Configuration | |
|