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

Safe HaskellNone
LanguageHaskell98

Hunt.Interpreter.Command

Description

"High-level" commands that are accepted by the (JSON) API.

These commands are translated with toBasicCommand to BasicCommands which can be interpreted.

Synopsis

Documentation

data Command Source

The "high-level" commands accepted by the Interpreter / JSON API. These are translated to BasicCommands.

Constructors

Search

Search query with pagination.

Completion

Auto-completion query with a limit.

Fields

icPrefixCR :: Query
 
icMaxCR :: Int
 
Select

Raw query without any ranking, scoring and ordering

Fields

icQuery :: Query
 
Insert

Insert a document.

Fields

icDoc :: ApiDocument
 
Update

Update a documents' description.

Fields

icDoc :: ApiDocument
 
Delete

Delete a documents by URI.

Fields

icUri :: URI
 
DeleteByQuery

Delete all documents of the query result.

Fields

icQueryD :: Query
 
InsertContext

Insert a context and the associated schema.

DeleteContext

Delete a context.

Fields

icDContext :: Context
 
LoadIx

Deserialize the index.

Fields

icPath :: FilePath
 
StoreIx

Serialize the index.

Fields

icPath :: FilePath
 
Status

Query general information about the server/index.

Fields

icStatus :: StatusCmd
 
Sequence

Sequence commands.

Fields

icCmdSeq :: [Command]
 
NOOP

No operation. Can be used in control flow and as an alive test.

data StatusCmd Source

Available status commands.

Constructors

StatusGC

Garbage collection statistics.

StatusDocTable

Document table JSON dump.

StatusIndex

Index JSON dump.

StatusContext Context

Index context dump

data CmdResult Source

The result of an interpreted command.

Constructors

ResOK

The command was processed successfully.

ResSearch

The search results.

ResCompletion

The auto-completion results.

Fields

crWords :: [(Text, [Text])]
 
ResSuggestion

The simplified completion result

Fields

crSugg :: [(Text, Score)]
 
ResGeneric

A generic JSON result.

Fields

crGen :: Value
 

data CmdError Source

An error during processing of the command. This includes a error code and a message.

Constructors

ResError 

Fields

ceCode :: Int

Error code.

ceMsg :: Text

Message describing the error.

newtype CmdRes a Source

auxiliary type for parsing JSON CmdResult's of various kinds

usefull in hunt applications, not used within the hunt server

Constructors

CmdRes 

Fields

unCmdRes :: a
 

Instances

Show a => Show (CmdRes a) 
FromJSON a => FromJSON (CmdRes a) 

toBasicCommand :: Command -> BasicCommand Source

Transform the supported input command into lower level commands which are actually interpreted.

Transformations:

  • Multiple Deletes into a single DeleteDocs.

    • Multiple Inserts into a single or multiple InsertLists.