| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| An interface to functions to manipulate search conditions. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Synopsis | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Types | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| data Condition | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| data CondOption | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| data SearchSpeed | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| data SyntaxType | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| data Eclipse | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Manipulating conditions | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| newCondition :: IO Condition | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| newCondition creates an empty search condition. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| setPhrase :: Condition -> String -> IO () | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| setPhrase cond phrase stores a condition phrase into cond. The syntax of the phrase is assumed to be the normal syntax, unless you specify a SyntaxType explicitly with setOptions. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| addAttrCond :: Condition -> String -> IO () | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| addAttrCond cond expr appends an attribute search condition to cond. See the user's guide for explanation about the attribute search condition. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| setOrder :: Condition -> String -> IO () | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| setOrder cond expr stores an ordering expression into cond. See the user's guide for explanation about the ordering expression. By default, the result is sorted in descending order of score. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| setMax :: Condition -> Int -> IO () | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| setMax cond n specifies the maximum number of results. By default, the number of results is unlimited. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| setSkip :: Condition -> Int -> IO () | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| setSkip cond n specifies how many documents should be skipped from the beginning of result. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| setOptions :: Condition -> [CondOption] -> IO () | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| setOptions cond opts specifies options to the search condition. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| setAuxiliary :: Condition -> Int -> IO () | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| setAuxiliary cond min specifies how many documents should be in the result to avoid using the auxiliary index to pad the result. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| setEclipse :: Condition -> Eclipse -> IO () | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| setEclipse cond ecl specifies how to hide documents from the search result by their similarity. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| setDistinct :: Condition -> String -> IO () | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| setDistinct cond attr specifies an attribute which must be unique to the search result. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| setMetaSearchMask :: Condition -> [Int] -> IO () | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
setMetaSearchMask cond xs specifies that, in metaSearch, some databases must be excluded from the search result. e.g. main = withDatabase "db1" (Reader []) $ \ db1 ->
withDatabase "db2" (Reader []) $ \ db2 ->
withDatabase "db3" (Reader []) $ \ db3 ->
do cond <- newCondition
setPhrase cond "hello AND world"
setMetaSearchMask cond [0, 2] -- zero-origin
-- In this case, "db1" and "db3" are excluded from the meta search.
result <- metaSearch [db1, db2, db3]
print result
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Produced by Haddock version 0.8 |