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

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

Holumbus.Query.Result

Contents

Description

The data type for results of Holumbus queries.

The result of a query is defined in terms of two partial results, the documents containing the search terms and the words which are possible completions of the serach terms.

Synopsis

Result data types

data Result a Source

The combined result type for Holumbus queries.

Constructors

Result 

Fields

docHits :: DocHits a

The documents matching the query.

wordHits :: WordHits

The words which are completions of the query terms.

Instances

Eq a => Eq (Result a) 
Show a => Show (Result a) 
Binary a => Binary (Result a) 
NFData a => NFData (Result a) 
XmlPickler a => XmlPickler (Result a) 

type DocHits a = DocIdMap (DocInfo a, DocContextHits)Source

A mapping from a document to it's score and the contexts where it was found.

type DocContextHits = Map Context DocWordHitsSource

A mapping from a context to the words of the document that were found in this context.

type DocWordHits = Map Word PositionsSource

A mapping from a word of the document in a specific context to it's positions.

type WordHits = Map Word (WordInfo, WordContextHits)Source

A mapping from a word to it's score and the contexts where it was found.

type WordContextHits = Map Context WordDocHitsSource

A mapping from a context to the documents that contain the word that were found in this context.

type WordDocHits = OccurrencesSource

A mapping from a document containing the word to the positions of the word.

data DocInfo a Source

Information about an document.

Constructors

DocInfo 

Fields

document :: Document a

The document itself.

docScore :: Score

The score for the document (initial score for all documents is 0.0).

Instances

Eq a => Eq (DocInfo a) 
Show a => Show (DocInfo a) 
Binary a => Binary (DocInfo a) 
NFData a => NFData (DocInfo a) 
XmlPickler a => XmlPickler (DocInfo a) 

data WordInfo Source

Information about a word.

Constructors

WordInfo 

Fields

terms :: Terms

The search terms that led to this very word.

wordScore :: Score

The frequency of the word in the document for a context.

type Score = FloatSource

The score of a hit (either a document hit or a word hit).

Construction

emptyResult :: Result aSource

Create an empty result.

Query

null :: Result a -> BoolSource

Test if the result contains anything.

sizeDocHits :: Result a -> IntSource

Query the number of documents in a result.

sizeWordHits :: Result a -> IntSource

Query the number of documents in a result.

maxScoreDocHits :: Result a -> ScoreSource

Query the maximum score of the documents.

maxScoreWordHits :: Result a -> ScoreSource

Query the maximum score of the words.

getDocuments :: Result a -> [Document a]Source

Extract all documents from a result

Transform

setDocScore :: Score -> DocInfo a -> DocInfo aSource

Set the score in a document info.

setWordScore :: Score -> WordInfo -> WordInfoSource

Set the score in a word info.

Picklers

xpDocHits :: XmlPickler a => PU (DocHits a)Source

The XML pickler for the document hits. Will be sorted by score.

xpWordHits :: PU WordHitsSource

The XML pickler for the word hits. Will be sorted alphabetically by the words.