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

Safe HaskellNone
LanguageHaskell98

Hunt.Common.ApiDocument

Description

Document format for the interpreter and JSON API. It includes the document description, the index data and additional metadata.

Synopsis

Documentation

data ApiDocument Source

The document accepted by the interpreter and JSON API.

Constructors

ApiDocument 

Fields

adUri :: URI

The unique identifier.

adIndex :: IndexMap

The data to index according to schema associated with the context.

adDescr :: Description

The document description (a simple key-value map).

adWght :: Score

An optional document boost, (internal default is 1.0).

type IndexMap = Map Context Content Source

Context map

type AnalyzerFunction = Text -> [(Position, Text)] Source

Text analysis function

data LimitedResult x Source

Paginated result with an offset and chunk size.

Constructors

LimitedResult 

Fields

lrResult :: [x]

The list with at most lrMax elements.

lrOffset :: Int

The offset of the result.

lrMax :: Int

The limit for the result.

lrCount :: Int

The size of the complete result.

mkLimitedResult :: Int -> Int -> [x] -> LimitedResult x Source

Create a paginated result with an offset and a chunk size. The result also includes the size of the complete result.

emptyApiDocIndexMap :: IndexMap Source

Empty index content.

emptyApiDocDescr :: Description Source

Empty Document description.