Holumbus-Searchengine-1.2.3: A search and indexing engine.

Portabilityportable
Stabilityexperimental
MaintainerTimo B. Huebel (tbh@holumbus.org)
Safe HaskellNone

Holumbus.Query.Ranking

Contents

Description

Version : 0.3

The ranking mechanism for Holumbus.

Customized ranking functions for both documents and suggested words can be provided by the user. Some predefined ranking functions are avaliable, too.

Synopsis

Ranking types

data RankConfig a Source

The configuration of the ranking mechanism.

Constructors

RankConfig 

Fields

docRanking :: DocRanking a

A function to determine the score of a document.

wordRanking :: WordRanking

A funciton to determine the score of a word.

type DocRanking a = DocId -> DocInfo a -> DocContextHits -> ScoreSource

The signature of a function to determine the score of a document.

type WordRanking = Word -> WordInfo -> WordContextHits -> ScoreSource

The signature of a function to determine the score of a word.

Ranking

rank :: RankConfig a -> Result a -> Result aSource

Rank the result with custom ranking functions.

Predefined document rankings

docRankByCount :: DocId -> DocInfo a -> DocContextHits -> ScoreSource

Rank documents by count.

docRankWeightedByCount :: [(Context, Score)] -> DocId -> DocInfo a -> DocContextHits -> ScoreSource

Rank documents by context-weighted count. The weights will be normalized to a maximum of 1.0. Contexts with no weight (or a weight of zero) will be ignored.

Predefined word rankings

wordRankByCount :: Word -> WordInfo -> WordContextHits -> ScoreSource

Rank words by count.

wordRankWeightedByCount :: [(Context, Score)] -> Word -> WordInfo -> WordContextHits -> ScoreSource

Rank words by context-weighted count. The weights will be normalized to a maximum of 1.0. Contexts with no weight (or a weight of zero) will be ignored.