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

CopyrightCopyright (C) 2007, 2008 Timo B. Huebel
LicenseMIT
MaintainerTimo B. Huebel (tbh@holumbus.org)
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell98

Hunt.Query.Language.Parser

Contents

Description

Version : 0.2

The Hunt query parser, based on the famous Parsec library.

The parser implements a default syntax for the query grammar which exposes all possible query types and operators to the user.

Syntax:

AND, OR, AND NOT
= combinatory queries
!w
= case sensitive prefix query e.g.: !car or !Car
~w
= fuzzy word query e.g.: ~car or ~cra
"..."
= phrase query, performs an exact search for a single word
(...)
= brackets
c:w
= context sensitive queries e.g.: (who:Rudi Voeller)
c1,c2:w
= multi context queries e.g.: (content,who,title:Rudi Voeller)
@[... TO ...\
] = range queries e.g.: [2014-02-10 TO 2012-02-16]@
w^b
= query boosting e.g.: toList OR toAscList^1.5

Synopsis

Parsing

parseQuery :: String -> Either Text Query Source

Parse a query using the default syntax provided by the Hunt framework.