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

Safe HaskellNone
LanguageHaskell98

Hunt.Query.Language.Grammar

Contents

Description

The query language.

Query specifies the complete grammar.

Hunt.Query.Language.Parser provides a parser for plain text queries.

Synopsis

Query data types

data Query Source

The query language.

Constructors

QWord TextSearchType Text

prefix search for a word

QFullWord TextSearchType Text

search for a complete word

QPhrase TextSearchType Text

Phrase search.

QContext [Context] Query

Restrict a query to a list of contexts.

QBinary BinOp Query Query

Combine two queries with a binary operation.

QSeq BinOp [Query] 
QBoost Weight Query

Weight for query.

QRange Text Text

Range query.

data BinOp Source

A binary operation.

Constructors

And

Intersect two queries.

Or

Union two queries.

AndNot

Filter a query by another.

Phrase

Search for a sequence of words

Follow Int

Search a word followed another word within a distance

Near Int

search a word followed or preceded another word within a distance

data TextSearchType Source

The search opeation.

Constructors

QCase

Case-sensitive search.

QNoCase

Case-insensitive search.

QFuzzy

Fuzzy search. See Hunt.Query.Fuzzy for details. The query processor allows additional configuration with ProcessConfig.

escapeChar :: Char Source

The character an escape sequence starts with.

notWordChar :: String Source

Characters that cannot occur in a word (and have to be escaped).

Optimizing

optimize :: Query -> Query Source

Minor query optimizations.

Note: This can affect the ranking.

checkWith :: (Text -> Bool) -> Query -> Bool Source

Check if the query arguments comply with some custom predicate.

extractTerms :: Query -> [Text] Source

Returns a list of all terms in the query.

Pretty printing

printQuery :: Query -> Text Source

Renders a text representation of a Query.