HsHyperEstraier-0.1: HyperEstraier binding for HaskellContentsIndex
Text.HyperEstraier.Condition
Contents
Types
Manipulating conditions
Description
An interface to functions to manipulate search conditions.
Synopsis
data Condition
data CondOption
= Speed SearchSpeed
| OmitTFIDF
| Syntax SyntaxType
data SearchSpeed
= Slow
| Normal
| Fast
| EvenFaster
data SyntaxType
= Simplified
| Rough
| Union
| Intersection
data Eclipse
= Threshold Double
| ThresholdWithURL Double
| SameServer
| SameDirectory
| SameFile
newCondition :: IO Condition
setPhrase :: Condition -> String -> IO ()
addAttrCond :: Condition -> String -> IO ()
setOrder :: Condition -> String -> IO ()
setMax :: Condition -> Int -> IO ()
setSkip :: Condition -> Int -> IO ()
setOptions :: Condition -> [CondOption] -> IO ()
setAuxiliary :: Condition -> Int -> IO ()
setEclipse :: Condition -> Eclipse -> IO ()
setDistinct :: Condition -> String -> IO ()
setMetaSearchMask :: Condition -> [Int] -> IO ()
Types
data Condition
Condition is an opaque object representing a search condition.
data CondOption
CondOption is an option to the search condition.
Constructors
Speed SearchSpeedChoose a SearchSpeed.
OmitTFIDFOmit calculating TF-IDF weight.
Syntax SyntaxTypeChoose a SyntaxType.
show/hide Instances
data SearchSpeed
SearchSpeed is an option to the search condition.
Constructors
SlowSearch for all N-gram keys.
NormalSearch for N-gram keys alternately.
FastSearch for N-gram keys by skipping 2/3 of them.
EvenFasterSearch for N-gram keys by skipping 3/4 of them.
show/hide Instances
data SyntaxType
SyntaxType is an option to the search condition.
Constructors
SimplifiedInterpret the condition phrase as the simplified syntax. See the user's guide of the HyperEstraier for explanation about the simplified syntax.
RoughInterpret the condition phrase as the rough syntax. See the user's guide for details.
UnionInterpret the condition phrase as the union syntax. See the user's guide for details.
IntersectionInterpret the condition phrase as the intersection syntax. See the user's guide for details.
show/hide Instances
data Eclipse
Eclipse represents how to hide documents from the search result by their similarity.
Constructors
Threshold DoubleThreshold to cause eclipse to documents. Threshold x must satisfy 0.0 <= x <= 1.0.
ThresholdWithURL DoubleThis is similar to Threshold but this specifies that the document URI is also used to calculate the similarity.
SameServerCause eclipse to the documents on the same server.
SameDirectoryCause eclipse to the documents in the same directory.
SameFileCause eclipse to the documents whose file name is the same.
show/hide Instances
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