hunt-searchengine-0.3.0.1: A search and indexing engine.

Safe HaskellNone
LanguageHaskell98

Hunt.Query.Intermediate

Description

The intermediate query results which have to be merged for the various combinatorial operations.

toResult creates the final result which includes the document (and word) hits.

Synopsis

Documentation

class Aggregate a b where Source

Methods

aggregate :: a -> b Source

Instances

Aggregate a a

allow no aggregation

Aggregate ScoredRawDocs ScoredWords

aggregate the scored raw results by computing the score of all doc per word

Used in completion search. The sequence of words (in a phrase) is cut to the last word (L.last). For this last one the completions are computed.

Aggregate ScoredRawDocs UnScoredDocs

aggregate scored raw results into an unscored result by throwing away the words, scores and occurrences

Aggregate ScoredRawDocs ScoredDocs

aggregate scored raw results by throwing away the word hits and aggregating all document hits by throwing away the positions.

The function for computing the scores of documents in a query

Aggregate ScoredOccs Score

aggregate scored occurences to a score by aggregating first the positions and snd the doc ids

used in computing the score of word in completion search

Aggregate ScoredOccs UnScoredDocs

aggregate scored occurrences to unscored docs by throwing away the score

Aggregate ScoredOccs ScoredDocs

aggregate scored occurences by counting the positions per doc and boost the result with the score.

The positions in a doc are thrown away, so all kinds of phrase search become impossible

Aggregate ScoredDocs Score

aggregate scored docs to a single score by summing up the scores and throw away the DocIds

Aggregate a b => Aggregate (ScoredCx a) (ScoredCx b)

Lifting aggregation to scored context results

data ScoredDocs Source

Instances

Show ScoredDocs 
Monoid ScoredDocs 
ScoredResult ScoredDocs 
Aggregate ScoredRawDocs ScoredDocs

aggregate scored raw results by throwing away the word hits and aggregating all document hits by throwing away the positions.

The function for computing the scores of documents in a query

Aggregate ScoredOccs ScoredDocs

aggregate scored occurences by counting the positions per doc and boost the result with the score.

The positions in a doc are thrown away, so all kinds of phrase search become impossible

Aggregate ScoredDocs Score

aggregate scored docs to a single score by summing up the scores and throw away the DocIds

data ScoredWords Source

Instances

Show ScoredWords 
Monoid ScoredWords 
ScoredResult ScoredWords 
Aggregate ScoredRawDocs ScoredWords

aggregate the scored raw results by computing the score of all doc per word

Used in completion search. The sequence of words (in a phrase) is cut to the last word (L.last). For this last one the completions are computed.

data ScoredOccs Source

Instances

Show ScoredOccs 
Monoid ScoredOccs 
ScoredResult ScoredOccs 
Aggregate ScoredOccs Score

aggregate scored occurences to a score by aggregating first the positions and snd the doc ids

used in computing the score of word in completion search

Aggregate ScoredOccs UnScoredDocs

aggregate scored occurrences to unscored docs by throwing away the score

Aggregate ScoredOccs ScoredDocs

aggregate scored occurences by counting the positions per doc and boost the result with the score.

The positions in a doc are thrown away, so all kinds of phrase search become impossible

data ScoredRawDocs Source

Instances

Show ScoredRawDocs 
Monoid ScoredRawDocs 
ScoredResult ScoredRawDocs 
Aggregate ScoredRawDocs ScoredWords

aggregate the scored raw results by computing the score of all doc per word

Used in completion search. The sequence of words (in a phrase) is cut to the last word (L.last). For this last one the completions are computed.

Aggregate ScoredRawDocs UnScoredDocs

aggregate scored raw results into an unscored result by throwing away the words, scores and occurrences

Aggregate ScoredRawDocs ScoredDocs

aggregate scored raw results by throwing away the word hits and aggregating all document hits by throwing away the positions.

The function for computing the scores of documents in a query

data ScoredCx a Source

Add the Context dimension to a scored result

Instances

Functor ScoredCx 
Show a => Show (ScoredCx a) 
Monoid a => Monoid (ScoredCx a) 
ScoredResult a => ScoredResult (ScoredCx a) 
Aggregate a b => Aggregate (ScoredCx a) (ScoredCx b)

Lifting aggregation to scored context results

data UnScoredDocs Source

The result type for unscored search of documents

used when all matching docs must be processed, e.g. in DeleteByQuery commands

Instances

Show UnScoredDocs 
Monoid UnScoredDocs 
ScoredResult UnScoredDocs 
Aggregate ScoredRawDocs UnScoredDocs

aggregate scored raw results into an unscored result by throwing away the words, scores and occurrences

Aggregate ScoredOccs UnScoredDocs

aggregate scored occurrences to unscored docs by throwing away the score

newtype RankedDoc Source

Constructors

RD 

Fields

unRD :: (Score, Document)
 

boostAndAggregateCx :: ScoredResult a => ScoredContexts -> ScoredCx a -> a Source

The final op for a search result: boost the partial results of the contexts with the context weights from the schema and aggregate them by throwing away the contexts

limitCxRawResults :: Int -> CxRawResults -> CxRawResults Source

toDocsResult :: (Applicative m, Monad m, DocTable dt) => dt -> ScoredDocs -> m [RankedDoc] Source

convert a set of scored doc ids into a list of documents containing the score

This list may be further sorted by score, partitioned into pages or ...

evalSequence :: (ScoredResult r, Aggregate ScoredRawDocs r) => (ScoredCx ScoredRawDocs -> ScoredCx r) -> [ScoredCx ScoredRawDocs] -> ScoredCx r Source

combine a sequence of results from a phrase query into a single result and aggregate this result into a simpler structure, e.g. a ScoredDocs or ScoredWords value

The arguments must be of this unaggregated from, still containing word positions, else sequences of words are not detected

evalOr :: ScoredResult a => [a] -> a Source

evalAnd :: ScoredResult a => [a] -> a Source

evalAndNot :: ScoredResult a => [a] -> a Source